mirror of
https://github.com/github/codeql.git
synced 2025-12-17 09:13:20 +01:00
21 lines
474 B
JavaScript
21 lines
474 B
JavaScript
var exec = require('child_process').exec;
|
|
|
|
function asyncEach(arr, iterator) {
|
|
var i = 0;
|
|
(function iterate() {
|
|
iterator(arr[i++], function () {
|
|
if (i < arr.length)
|
|
process.nextTick(iterate);
|
|
});
|
|
})();
|
|
}
|
|
|
|
function execEach(commands) {
|
|
asyncEach(commands, (command) => exec(command)); // $ Alert
|
|
};
|
|
|
|
require('http').createServer(function(req, res) {
|
|
let cmd = require('url').parse(req.url, true).query.path; // $ Source
|
|
execEach([cmd]);
|
|
});
|