diff --git a/src/commander.ts b/src/commander.ts index e20049db7..006417aea 100644 --- a/src/commander.ts +++ b/src/commander.ts @@ -223,7 +223,7 @@ export class Commander { const renderLine = (job: Job) => { const needs = job.needs?.filter(n => !n.project && !n.pipeline).map(n => n.job); - const allowFailure = job.allowFailure ? "true " : "false"; + const allowFailure = job.allowFailure ? "true " : "false "; let jobLine = chalk`{blueBright ${job.name.padEnd(jobNamePad)}} ${job.description.padEnd(descriptionPadEnd)} `; jobLine += chalk`{yellow ${job.stage.padEnd(stagePadEnd)}} ${job.when.padEnd(whenPadEnd)} ${allowFailure.padEnd(11)}`; if (needs) { @@ -268,7 +268,7 @@ export class Commander { writeStreams.stdout("name;description;stage;when;allowFailure;needs\n"); jobs.forEach((job) => { const needs = job.needs?.filter(n => !n.project && !n.pipeline).map(n => n.job).join(",") ?? []; - writeStreams.stdout(`${job.name};"${job.description}";${job.stage};${job.when};${job.allowFailure};[${needs}]\n`); + writeStreams.stdout(`${job.name};"${job.description}";${job.stage};${job.when};${job.allowFailure ? "true" : "false"};[${needs}]\n`); }); } diff --git a/src/parser.ts b/src/parser.ts index d6a8af143..f585e15d3 100644 --- a/src/parser.ts +++ b/src/parser.ts @@ -251,10 +251,10 @@ export class Parser { let index = 0; if (expandVariables) { for (const line of fileSplit) { - interactiveMatch = !interactiveMatch ? /#\s?@\s?[Ii]nteractive/.exec(line) : interactiveMatch; - injectSSHAgent = !injectSSHAgent ? /#\s?@\s?[Ii]njectSSHAgent/.exec(line) : injectSSHAgent; - noArtifactsToSourceMatch = !noArtifactsToSourceMatch ? /#\s?@\s?NoArtifactsToSource/i.exec(line) : noArtifactsToSourceMatch; - descriptionMatch = !descriptionMatch ? /#\s?@\s?[Dd]escription (?.*)/.exec(line) : descriptionMatch; + interactiveMatch = interactiveMatch ?? /#\s?@\s?[Ii]nteractive/.exec(line); + injectSSHAgent = injectSSHAgent ?? /#\s?@\s?[Ii]njectSSHAgent/.exec(line); + noArtifactsToSourceMatch = noArtifactsToSourceMatch ?? /#\s?@\s?NoArtifactsToSource/i.exec(line); + descriptionMatch = descriptionMatch ?? /#\s?@\s?[Dd]escription (?.*)/.exec(line); const jobMatch = /\w:/.exec(line); if (jobMatch && (interactiveMatch || descriptionMatch || injectSSHAgent || noArtifactsToSourceMatch)) {