diff --git a/engine/parser.ts b/engine/parser.ts index b021d1f5..2a124456 100644 --- a/engine/parser.ts +++ b/engine/parser.ts @@ -42,10 +42,11 @@ export class Parser { } getLines(parseResult, index):Command[]{ + let linebreak = process.platform=="win32" ? "\r\n" : "\n"; try { - return (parseResult[2][index][6].steplines || parseResult[2][index][2][6].steplines).split("\r\n").filter(e => e != '').map(e => this.createCommand(e)); + return (parseResult[2][index][6].steplines || parseResult[2][index][2][6].steplines).split(linebreak).filter(e => e != '').map(e => this.createCommand(e)); } catch (error) { - return parseResult[2][index][2][6].steplines.split("\r\n").filter(e => e != '').map(e => this.createCommand(e)); + return parseResult[2][index][2][6].steplines.split(linebreak).filter(e => e != '').map(e => this.createCommand(e)); } } diff --git a/runners/katacoda/index.ts b/runners/katacoda/index.ts index 31e26517..77783f42 100644 --- a/runners/katacoda/index.ts +++ b/runners/katacoda/index.ts @@ -115,7 +115,6 @@ export class Katacoda extends Runner { "name": "Restore Devonfw IDE", "script": "restoreDevonfwIde.sh" }); - //update working directory this.setVariable(this.workspaceDirectory, path.join("/root", "devonfw", "workspaces", "main")); this.setVariable(this.useDevonCommand, true); @@ -379,7 +378,7 @@ export class Katacoda extends Runner { } private pushStep(runCommand: RunCommand, title: string, text: string) { - if (this.steps.length == this.stepsCount - 1) { + if (runCommand.stepIndex == this.stepsCount - 1 && runCommand.lineIndex == 0) { let stepTitle = runCommand.stepTitle ? runCommand.stepTitle : title; this.steps.push({ "title": stepTitle,