From 0f20b0b8b81edad302e6cfe8c8974729ed9a1b43 Mon Sep 17 00:00:00 2001 From: Maksim Gruzdev Date: Fri, 31 Jan 2025 17:36:20 +0300 Subject: [PATCH 1/2] HOTFIX --- lib/ShellCommand.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/ShellCommand.js b/lib/ShellCommand.js index 55a9832..6a0ef7c 100644 --- a/lib/ShellCommand.js +++ b/lib/ShellCommand.js @@ -28,9 +28,8 @@ module.exports = class ShellCommand { return global.FUZZ_SHELL_REPLY } return new Promise((ok, fail) => { - const [the_cmd, tail] = this.cmd.split(' || true') - const is_always_ok = tail === '' - const [cmd, ...args] = the_cmd.split(' ') + const cmd = 'sh' + const args = ['-c', this.cmd] const env = { ...process.env, TERM: 'xterm-256color' @@ -50,7 +49,7 @@ module.exports = class ShellCommand { }) subprocess.on('exit', (code) => { - if (code === 0 || is_always_ok) { + if (code === 0) { ok(stdout.toString().trim()) } else { fail(new Error(stderr.toString().trim())) From ba438824a976c4a84fff6aec774cc814a090be47 Mon Sep 17 00:00:00 2001 From: Maksim Gruzdev Date: Fri, 31 Jan 2025 17:46:01 +0300 Subject: [PATCH 2/2] FIX double message stderr + stdout on error --- mr.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mr.js b/mr.js index 8d603b2..5506eda 100644 --- a/mr.js +++ b/mr.js @@ -28,7 +28,7 @@ module.exports = { try { await main (process.argv.slice (2)) } catch (x) { - console.log (new Error (x).message) return '' + x } + })()