From 319f28dca5d55eb1b3166fe1c446e100d17df6e0 Mon Sep 17 00:00:00 2001 From: lamovv Date: Tue, 19 Jul 2022 18:06:13 +0800 Subject: [PATCH 1/2] fix(run-exec): Compatible with catch exception details output in error.stdout --- lib/run-exec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/run-exec.js b/lib/run-exec.js index eec2feb3d..51ffde7c7 100644 --- a/lib/run-exec.js +++ b/lib/run-exec.js @@ -12,7 +12,7 @@ module.exports = async function (args, cmd) { return stdout } catch (error) { // If exec returns an error, print it and exit with return code 1 - printError(args, error.stderr || error.message) + printError(args, error.stderr || error.stdout || error.message) throw error } } From 842b09d057aae281c64ea2c588ee601eb842d349 Mon Sep 17 00:00:00 2001 From: lamovv Date: Tue, 19 Jul 2022 18:21:11 +0800 Subject: [PATCH 2/2] feat(print-error): Add configuration parameters, output error when exec(cmd) exceptions facilitate troubleshooting --- lib/print-error.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/print-error.js b/lib/print-error.js index 84aaa8257..bdafa77ef 100644 --- a/lib/print-error.js +++ b/lib/print-error.js @@ -1,7 +1,7 @@ const chalk = require('chalk') module.exports = function (args, msg, opts) { - if (!args.silent) { + if (!args.silent || args.printError) { opts = Object.assign({ level: 'error', color: 'red'