Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function runCompiler(dir, ...cmd) {
return new qx.Promise((resolve, reject) => {
cmd.push("--machine-readable");
let proc = child_process.spawn("qx", cmd, {
cwd: dir,
shell: true
});
let result = {
exitCode: null,
output: "",
messages: null
};
proc.stdout.on('data', data => result.output += data);
proc.stderr.on('data', data => result.output += data);
proc.on('close', code => {
result.exitCode = code;
result.messages = [];