From f05fddcb2a71d74e7fbe5f165fc21df9c8e38fe2 Mon Sep 17 00:00:00 2001 From: Abhishek Anand Date: Wed, 14 Feb 2024 13:39:26 +0530 Subject: [PATCH] exex to spawn for bolt --- dist/index.js | 14 ++++++++++++-- src/main.js | 14 ++++++++++++-- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/dist/index.js b/dist/index.js index 97a29b9..82da449 100644 --- a/dist/index.js +++ b/dist/index.js @@ -4254,9 +4254,19 @@ async function run() { `BOLT_MODE=${mode} BOLT_ALLOW_HTTP=${ allow_http} BOLT_DEFAULT_POLICY=${default_policy} $HOME/.local/bin/mitmdump --mode transparent --showhost --set block_global=false -s /home/mitmproxyuser/intercept.py &` ]; // core.info(runBoltCommand) - spawn(boltCommand, boltArgs , { - detached: true + const cp = spawn(boltCommand, boltArgs); + + cp.stdout.on('data', (data) => { + core.info(`stdout: ${data}`); + }); + + cp.stderr.on('data', (data) => { + core.error(`stderr: ${data}`); }); + + cp.on('close', (code) => { + core.info(`child process exited with code ${code}`); + }); core.info('Waiting for bolt to start...') const ms = 5000 diff --git a/src/main.js b/src/main.js index 104d56c..167510b 100644 --- a/src/main.js +++ b/src/main.js @@ -68,9 +68,19 @@ async function run() { `BOLT_MODE=${mode} BOLT_ALLOW_HTTP=${ allow_http} BOLT_DEFAULT_POLICY=${default_policy} $HOME/.local/bin/mitmdump --mode transparent --showhost --set block_global=false -s /home/mitmproxyuser/intercept.py &` ]; // core.info(runBoltCommand) - spawn(boltCommand, boltArgs , { - detached: true + const cp = spawn(boltCommand, boltArgs); + + cp.stdout.on('data', (data) => { + core.info(`stdout: ${data}`); + }); + + cp.stderr.on('data', (data) => { + core.error(`stderr: ${data}`); }); + + cp.on('close', (code) => { + core.info(`child process exited with code ${code}`); + }); core.info('Waiting for bolt to start...') const ms = 5000