From 8fd06c9b92f4d956fcb6157702c1a6f2aca768c5 Mon Sep 17 00:00:00 2001 From: denise-khuu <74537227+denise-khuu@users.noreply.github.com> Date: Wed, 23 Dec 2020 13:36:54 +0100 Subject: [PATCH 1/4] restoreDevonIde for Console --- documentation/Functions.md | 13 ++++++++++++- runners/console/index.ts | 23 +++++++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/documentation/Functions.md b/documentation/Functions.md index a9eefb1a..2740726d 100644 --- a/documentation/Functions.md +++ b/documentation/Functions.md @@ -18,6 +18,17 @@ installDevonfwIde(["java","mvn"], "2020.08.001") *** +### restoreDevonfwIde +#### parameter +1. The tools you want to install within the devonfw ide: string array +2. Optional: The version of the ide to install +#### example +restoreDevonfwIde(["java","mvn"], "2020.08.001") +#### details +The installation of the devonfw IDE is executed in a startup script. + +*** + ### installCobiGen #### parameter * No parameters @@ -95,4 +106,4 @@ A placeholder is optional. If you do not define a placeholder, the content in th Please try not to use custom placeholders. Keep in mind that you might want to build the project before changing them. Custom placeholders with a comment-syntax (e.g. "//PLACEHOLDER") will be removed by the console-environment and others might cause errors. -*** +*** \ No newline at end of file diff --git a/runners/console/index.ts b/runners/console/index.ts index 04feb102..d932cfa9 100644 --- a/runners/console/index.ts +++ b/runners/console/index.ts @@ -52,6 +52,14 @@ export class Console extends Runner { return result; } + + runRestoreDevonfwIde(step: Step, command: Command): RunResult { + let result = new RunResult(); + result.returnCode = 0; + result = this.runInstallDevonfwIde (step, command); + return result; + } + runInstallCobiGen(step: Step, command: Command): RunResult { let result = new RunResult(); result.returnCode = 0; @@ -158,6 +166,21 @@ export class Console extends Runner { } } + async assertRestoreDevonfwIde(step: Step, command: Command, result: RunResult) { + let installedTools = command.parameters[0]; + + let assert = new Assertions() + .noErrorCode(result) + .noException(result) + .directoryExits(path.join(this.getWorkingDirectory(), "devonfw", "software")) + .directoryExits(path.join(this.getWorkingDirectory(), "devonfw", "workspaces", "main")); + + for(let i = 0; i < installedTools.length; i++) { + if(installedTools[i] == "mvn") installedTools[i] = "maven"; + assert.directoryExits(path.join(this.getWorkingDirectory(), "devonfw", "software", installedTools[i])); + } + } + async assertInstallCobiGen(step: Step, command: Command, result: RunResult) { let assert = new Assertions() .noErrorCode(result) From 76c696cd96ca7d94ca6ecb2661d9effd6bc660c1 Mon Sep 17 00:00:00 2001 From: denise-khuu <74537227+denise-khuu@users.noreply.github.com> Date: Wed, 23 Dec 2020 13:55:40 +0100 Subject: [PATCH 2/4] restoreDEvonfwIde for console --- documentation/Functions.md | 3 +-- runners/console/index.ts | 15 ++------------- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/documentation/Functions.md b/documentation/Functions.md index 2740726d..0d35df10 100644 --- a/documentation/Functions.md +++ b/documentation/Functions.md @@ -25,8 +25,7 @@ installDevonfwIde(["java","mvn"], "2020.08.001") #### example restoreDevonfwIde(["java","mvn"], "2020.08.001") #### details -The installation of the devonfw IDE is executed in a startup script. - +In the Katacoda Environment the installation of the devonfw IDE is executed in a startup script. *** ### installCobiGen diff --git a/runners/console/index.ts b/runners/console/index.ts index d932cfa9..82bacceb 100644 --- a/runners/console/index.ts +++ b/runners/console/index.ts @@ -56,7 +56,7 @@ export class Console extends Runner { runRestoreDevonfwIde(step: Step, command: Command): RunResult { let result = new RunResult(); result.returnCode = 0; - result = this.runInstallDevonfwIde (step, command); + result = this.runInstallDevonfwIde(step, command); return result; } @@ -167,18 +167,7 @@ export class Console extends Runner { } async assertRestoreDevonfwIde(step: Step, command: Command, result: RunResult) { - let installedTools = command.parameters[0]; - - let assert = new Assertions() - .noErrorCode(result) - .noException(result) - .directoryExits(path.join(this.getWorkingDirectory(), "devonfw", "software")) - .directoryExits(path.join(this.getWorkingDirectory(), "devonfw", "workspaces", "main")); - - for(let i = 0; i < installedTools.length; i++) { - if(installedTools[i] == "mvn") installedTools[i] = "maven"; - assert.directoryExits(path.join(this.getWorkingDirectory(), "devonfw", "software", installedTools[i])); - } + this.assertInstallDevonfwIde(step, command, result); } async assertInstallCobiGen(step: Step, command: Command, result: RunResult) { From aa281e6c39c28d3c4c52cc9b6b8ab6fb17e003a4 Mon Sep 17 00:00:00 2001 From: denise-khuu <74537227+denise-khuu@users.noreply.github.com> Date: Wed, 23 Dec 2020 13:57:36 +0100 Subject: [PATCH 3/4] changed documentation --- documentation/Functions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/Functions.md b/documentation/Functions.md index 0d35df10..49b93ea6 100644 --- a/documentation/Functions.md +++ b/documentation/Functions.md @@ -25,7 +25,7 @@ installDevonfwIde(["java","mvn"], "2020.08.001") #### example restoreDevonfwIde(["java","mvn"], "2020.08.001") #### details -In the Katacoda Environment the installation of the devonfw IDE is executed in a startup script. +In the Katacoda environment the installation of the devonfw IDE is executed in a startup script. *** ### installCobiGen From 4da72a5bbb19e644adf97bdbeb5d94dc30933169 Mon Sep 17 00:00:00 2001 From: denise-khuu <74537227+denise-khuu@users.noreply.github.com> Date: Wed, 23 Dec 2020 14:10:35 +0100 Subject: [PATCH 4/4] restoreDevonfwIde for console --- runners/console/index.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/runners/console/index.ts b/runners/console/index.ts index 82bacceb..ae6a4341 100644 --- a/runners/console/index.ts +++ b/runners/console/index.ts @@ -54,10 +54,7 @@ export class Console extends Runner { runRestoreDevonfwIde(step: Step, command: Command): RunResult { - let result = new RunResult(); - result.returnCode = 0; - result = this.runInstallDevonfwIde(step, command); - return result; + return this.runInstallDevonfwIde(step, command); } runInstallCobiGen(step: Step, command: Command): RunResult {