From a91c7b4e706fa78e29612b00bd4d3cead03a529d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Minelli?= <michael@minelli.me> Date: Thu, 18 Jan 2024 01:06:39 +0100 Subject: [PATCH] AssignmentCheck => Update log function --- .../assignment/subcommands/AssignmentCheckCommand.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/NodeApp/src/commander/assignment/subcommands/AssignmentCheckCommand.ts b/NodeApp/src/commander/assignment/subcommands/AssignmentCheckCommand.ts index 8201f3a..f8ca9db 100644 --- a/NodeApp/src/commander/assignment/subcommands/AssignmentCheckCommand.ts +++ b/NodeApp/src/commander/assignment/subcommands/AssignmentCheckCommand.ts @@ -32,14 +32,18 @@ class AssignmentCheckCommand extends CommanderCommand { let spinner: ora.Ora; if ( verbose ) { - let buildPhase: boolean = true; - assignmentValidator.events.on('logs', (log: string, _error: boolean, displayable: boolean, _currentStep: string, currentSubStep: string) => { + let buildPhase: boolean | undefined = undefined; + assignmentValidator.events.on('logs', (log: string, error: boolean, displayable: boolean, _currentStep: string, currentSubStep: string) => { for ( const line of log.split('\n') ) { - if ( currentSubStep == 'COMPOSE_RUN' && buildPhase && line != '' && !line.startsWith('#') ) { + if ( displayable && buildPhase == undefined && line.startsWith('#') ) { + buildPhase = true; + } + + if ( currentSubStep == 'COMPOSE_RUN' && buildPhase === true && line != '' && !line.startsWith('#') ) { buildPhase = false; } - if ( displayable && (options.superVerbose || !buildPhase) ) { + if ( displayable && (options.superVerbose || buildPhase === false) ) { console.log(line); } } -- GitLab