|
|
@ -3,18 +3,11 @@ const logger = require("./logger.js")("exec");
|
|
|
|
const { spawn } = require("child_process");
|
|
|
|
const { spawn } = require("child_process");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function exec(cmd, stdout, stderr, exit_handler){
|
|
|
|
function exec(cmd, options){
|
|
|
|
const [bin, ...args] = cmd.split(' ')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
logger.addContext("binary", "bin");
|
|
|
|
logger.addContext("binary", "bin");
|
|
|
|
logger.debug(`Spawn process '${cmd}'`);
|
|
|
|
logger.debug(`Spawn process '${cmd}'`);
|
|
|
|
let proc = spawn(bin, args);
|
|
|
|
return spawn(bin, args, options);
|
|
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
|
|
|
"process": proc,
|
|
|
|
|
|
|
|
"stdout": proc.stdout,
|
|
|
|
|
|
|
|
"stderr": proc.stderr
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Specify exports
|
|
|
|
// Specify exports
|
|
|
|