add optional logging, cleanup fixes
This commit is contained in:
@@ -1,20 +1,20 @@
|
||||
const childProcess = require("child_process");
|
||||
|
||||
const runFile = (folder, file, args, onExit) => {
|
||||
childProcess.execFile(file, args, {
|
||||
cwd: folder
|
||||
}, (_err, _stdout, _stdin) => {
|
||||
if (onExit) onExit();
|
||||
})
|
||||
}
|
||||
childProcess.execFile(file, args, {
|
||||
cwd: folder,
|
||||
}, (_err, _stdout, _stdin) => {
|
||||
if (onExit) onExit();
|
||||
});
|
||||
};
|
||||
|
||||
const runFileDetached = (folder, file, args) => {
|
||||
const subProcess = childProcess.spawn(file + (args ? " " + args : ''), {
|
||||
cwd: folder,
|
||||
detached: true,
|
||||
stdio: 'ignore'
|
||||
});
|
||||
subProcess.unref();
|
||||
}
|
||||
const subProcess = childProcess.spawn(file + (args ? " " + args : ""), {
|
||||
cwd: folder,
|
||||
detached: true,
|
||||
stdio: "ignore",
|
||||
});
|
||||
subProcess.unref();
|
||||
};
|
||||
|
||||
module.exports = { runFile, runFileDetached };
|
||||
module.exports = { runFile, runFileDetached };
|
||||
|
Reference in New Issue
Block a user