From 8ff81d8c1c8f9d81825e2f68a1f2cc1cb6a9f5fe Mon Sep 17 00:00:00 2001 From: Maxim Date: Mon, 8 Mar 2021 09:49:42 +0000 Subject: [PATCH] fix: #40 batch error should result in exitcode 1 (#41) --- core/cli/src/utils/status.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/cli/src/utils/status.ts b/core/cli/src/utils/status.ts index d116739..a1e3780 100644 --- a/core/cli/src/utils/status.ts +++ b/core/cli/src/utils/status.ts @@ -13,6 +13,7 @@ export class Status { logs: string[]; } >(); + private hasBatchErrors = false; private timeStartedByProject = new Map(); @@ -30,7 +31,7 @@ export class Status { get hasErrors() { return Array.from(this.actionsByProjectName.values()).some(stat => Boolean(stat.hasErrors) - ); + ) || this.hasBatchErrors; } setActions(...actions: Action[]) { @@ -189,6 +190,9 @@ export class Status { ).join(' ') ); } + if (entry.level === 'error') { + this.hasBatchErrors = true; + } }); this.onChange({ done, dynamic: [], height: 0 }); }