mirror of
https://github.com/pyTooling/Actions.git
synced 2026-02-12 02:56:56 +08:00
'online' logs from subprocess
This commit is contained in:
@@ -26,14 +26,13 @@
|
|||||||
* ================================================================================================================== */
|
* ================================================================================================================== */
|
||||||
const { exec } = require("child_process");
|
const { exec } = require("child_process");
|
||||||
|
|
||||||
function run(cmd) {
|
function run(cmdline) {
|
||||||
exec(cmd, (error, stdout, stderr) => {
|
var args = cmdline.split(' ');
|
||||||
if ( stdout.length !== 0 ) { console.log(`${stdout}`); }
|
const cmd = args.shift();
|
||||||
if ( stderr.length !== 0 ) { console.error(`${stderr}`); }
|
|
||||||
if (error) {
|
const subprocess = spawn(cmd, args, { stdio: 'inherit' });
|
||||||
process.exitCode = error.code;
|
subprocess.on('exit', (exit_code) => {
|
||||||
console.error(`${error}`);
|
process.exitCode = exit_code
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user