chore: oneliner output for command debug logs

pull/413/head
Webber 2022-08-06 23:06:29 +02:00
parent 38285d014c
commit 4d8b198d3f
2 changed files with 6 additions and 6 deletions

View File

@ -74,6 +74,8 @@
// App it not yet internationalised // App it not yet internationalised
"i18n-text/no-en": "off", "i18n-text/no-en": "off",
// Showing false positives (enable after upgrading) // Showing false positives (enable after upgrading)
"no-shadow": "off" "no-shadow": "off",
// (enable to add improvements)
"unicorn/no-static-only-class": "off"
} }
} }

View File

@ -30,7 +30,6 @@ interface IOptions {
continueOnError?: boolean; continueOnError?: boolean;
} }
// Todo - change signature of exec inside the code instead of adapting the exec method
const exec = async ( const exec = async (
command: string, command: string,
args: string | string[] = [], args: string | string[] = [],
@ -47,15 +46,14 @@ const exec = async (
if (ignoreReturnCode) options.continueOnError = true; if (ignoreReturnCode) options.continueOnError = true;
const argsString = typeof args === 'string' ? args : args.join(' '); const argsString = typeof args === 'string' ? args : args.join(' ');
log.debug('Command: ', command, argsString);
const result: ICommandResult = await originalExec(`${command} ${argsString}`, options); const result: ICommandResult = await originalExec(`${command} ${argsString}`, options);
log.debug('Result:', result);
const { status, output = '' } = result; const { status, output = '' } = result;
const { code: exitCode, success } = status; const { code: exitCode, success } = status;
const symbol = success ? '✅' : '❗';
log.debug('Command:', command, argsString, symbol, result);
return { exitCode, success, output: output.trim() }; return { exitCode, success, output: output.trim() };
}; };