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");
|
||||
|
||||
function run(cmd) {
|
||||
exec(cmd, (error, stdout, stderr) => {
|
||||
if ( stdout.length !== 0 ) { console.log(`${stdout}`); }
|
||||
if ( stderr.length !== 0 ) { console.error(`${stderr}`); }
|
||||
if (error) {
|
||||
process.exitCode = error.code;
|
||||
console.error(`${error}`);
|
||||
}
|
||||
function run(cmdline) {
|
||||
var args = cmdline.split(' ');
|
||||
const cmd = args.shift();
|
||||
|
||||
const subprocess = spawn(cmd, args, { stdio: 'inherit' });
|
||||
subprocess.on('exit', (exit_code) => {
|
||||
process.exitCode = exit_code
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user