Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/commander.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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`);
});
}

Expand Down
8 changes: 4 additions & 4 deletions src/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 (?<description>.*)/.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 (?<description>.*)/.exec(line);

const jobMatch = /\w:/.exec(line);
if (jobMatch && (interactiveMatch || descriptionMatch || injectSSHAgent || noArtifactsToSourceMatch)) {
Expand Down