Skip to content

Commit

Permalink
Fix #60
Browse files Browse the repository at this point in the history
  • Loading branch information
TWiStErRob committed Dec 8, 2023
1 parent ee6cca8 commit 2bbc89a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/output-parser/output-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ export class OutputParser {
// keep track of groups for the current step of a job
private groupMatrix: Record<string, Group[]>;

private isPartOfGroup: boolean;
private isPartOfGroup: Record<string, boolean>;

constructor(output: string) {
this.output = output;
this.stepMatrix = {};
this.outputMatrix = {};
this.groupMatrix = {};
this.isPartOfGroup = false;
this.isPartOfGroup = {};
}

/**
Expand Down Expand Up @@ -140,7 +140,7 @@ export class OutputParser {
// if the line is an output line
if (stepOutputMatcherResult !== null) {
// if output is part of some group then update it
if (this.isPartOfGroup) {
if (this.isPartOfGroup[stepOutputMatcherResult[1]]) {
const length = this.groupMatrix[stepOutputMatcherResult[1]].length;
this.groupMatrix[stepOutputMatcherResult[1]][length - 1].output +=
stepOutputMatcherResult[2] + "\n";
Expand All @@ -167,7 +167,7 @@ export class OutputParser {
name: startGroupMatcherResult[2],
output: "",
});
this.isPartOfGroup = true;
this.isPartOfGroup[startGroupMatcherResult[1]] = true;
}
}

Expand All @@ -187,7 +187,7 @@ export class OutputParser {
const length = this.groupMatrix[endGroupMatcherResult[1]].length;
this.groupMatrix[endGroupMatcherResult[1]][length - 1].output =
this.groupMatrix[endGroupMatcherResult[1]][length - 1].output.trim();
this.isPartOfGroup = false;
this.isPartOfGroup[endGroupMatcherResult[1]] = false;
}
}

Expand Down

0 comments on commit 2bbc89a

Please sign in to comment.