Skip to content

Commit

Permalink
fixup! feat(ng-dev): create system for registering functions to be ca…
Browse files Browse the repository at this point in the history
…lled on command completion
  • Loading branch information
josephperrott committed Aug 11, 2022
1 parent d673580 commit 3310e7c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ng-dev/utils/yargs.ts
Expand Up @@ -27,8 +27,14 @@ export function runParserWithCompletedFunctions(applyConfiguration: (argv: Argv)
applyConfiguration(yargs([])).parse(
process.argv.slice(2),
async (err: Error | null, _: Arguments, output: string) => {
if (err && [undefined, 0].includes(process.exitCode)) {
process.exitCode = 1;
}
if (err) {
Log.debug(err);
}
if (output) {
err = new YargsError();
err = err || new YargsError();
Log.log(output);
}
for (const completedFunc of completedFunctions) {
Expand Down

0 comments on commit 3310e7c

Please sign in to comment.