From 4d8b198d3f65a15d5c91a39282345064db778de2 Mon Sep 17 00:00:00 2001 From: Webber Date: Sat, 6 Aug 2022 23:06:29 +0200 Subject: [PATCH] chore: oneliner output for command debug logs --- .eslintrc.json | 4 +++- src/modules/actions/exec.ts | 8 +++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 61b4ebef..aaf80033 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -74,6 +74,8 @@ // App it not yet internationalised "i18n-text/no-en": "off", // Showing false positives (enable after upgrading) - "no-shadow": "off" + "no-shadow": "off", + // (enable to add improvements) + "unicorn/no-static-only-class": "off" } } diff --git a/src/modules/actions/exec.ts b/src/modules/actions/exec.ts index 531b8c2a..03ee5d6d 100644 --- a/src/modules/actions/exec.ts +++ b/src/modules/actions/exec.ts @@ -30,7 +30,6 @@ interface IOptions { continueOnError?: boolean; } -// Todo - change signature of exec inside the code instead of adapting the exec method const exec = async ( command: string, args: string | string[] = [], @@ -47,15 +46,14 @@ const exec = async ( if (ignoreReturnCode) options.continueOnError = true; const argsString = typeof args === 'string' ? args : args.join(' '); - log.debug('Command: ', command, argsString); - const result: ICommandResult = await originalExec(`${command} ${argsString}`, options); - log.debug('Result:', result); - const { status, output = '' } = result; const { code: exitCode, success } = status; + const symbol = success ? '✅' : '❗'; + log.debug('Command:', command, argsString, symbol, result); + return { exitCode, success, output: output.trim() }; };