Skip to content

Commit 9fe3c6c

Browse files
Fixed condition of pushStep
1 parent 3bbcfdb commit 9fe3c6c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

engine/parser.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,11 @@ export class Parser {
4242
}
4343

4444
getLines(parseResult, index):Command[]{
45+
let linebreak = process.platform=="win32" ? "\r\n" : "\n";
4546
try {
46-
return (parseResult[2][index][6].steplines || parseResult[2][index][2][6].steplines).split("\r\n").filter(e => e != '').map(e => this.createCommand(e));
47+
return (parseResult[2][index][6].steplines || parseResult[2][index][2][6].steplines).split(linebreak).filter(e => e != '').map(e => this.createCommand(e));
4748
} catch (error) {
48-
return parseResult[2][index][2][6].steplines.split("\r\n").filter(e => e != '').map(e => this.createCommand(e));
49+
return parseResult[2][index][2][6].steplines.split(linebreak).filter(e => e != '').map(e => this.createCommand(e));
4950
}
5051
}
5152

runners/katacoda/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ export class Katacoda extends Runner {
115115
"name": "Restore Devonfw IDE",
116116
"script": "restoreDevonfwIde.sh"
117117
});
118-
119118
//update working directory
120119
this.setVariable(this.workspaceDirectory, path.join("/root", "devonfw", "workspaces", "main"));
121120
this.setVariable(this.useDevonCommand, true);
@@ -379,7 +378,7 @@ export class Katacoda extends Runner {
379378
}
380379

381380
private pushStep(runCommand: RunCommand, title: string, text: string) {
382-
if (this.steps.length == this.stepsCount - 1) {
381+
if (runCommand.stepIndex == this.stepsCount - 1 && runCommand.lineIndex == 0) {
383382
let stepTitle = runCommand.stepTitle ? runCommand.stepTitle : title;
384383
this.steps.push({
385384
"title": stepTitle,

0 commit comments

Comments
 (0)