Skip to content

Commit 8fd06c9

Browse files
committed
restoreDevonIde for Console
1 parent ce6dc7c commit 8fd06c9

File tree

2 files changed

+35
-1
lines changed

2 files changed

+35
-1
lines changed

documentation/Functions.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,17 @@ installDevonfwIde(["java","mvn"], "2020.08.001")
1818

1919
***
2020

21+
### restoreDevonfwIde
22+
#### parameter
23+
1. The tools you want to install within the devonfw ide: string array
24+
2. Optional: The version of the ide to install
25+
#### example
26+
restoreDevonfwIde(["java","mvn"], "2020.08.001")
27+
#### details
28+
The installation of the devonfw IDE is executed in a startup script.
29+
30+
***
31+
2132
### installCobiGen
2233
#### parameter
2334
* No parameters
@@ -95,4 +106,4 @@ A placeholder is optional. If you do not define a placeholder, the content in th
95106

96107
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.
97108

98-
***
109+
***

runners/console/index.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,14 @@ export class Console extends Runner {
5252
return result;
5353
}
5454

55+
56+
runRestoreDevonfwIde(step: Step, command: Command): RunResult {
57+
let result = new RunResult();
58+
result.returnCode = 0;
59+
result = this.runInstallDevonfwIde (step, command);
60+
return result;
61+
}
62+
5563
runInstallCobiGen(step: Step, command: Command): RunResult {
5664
let result = new RunResult();
5765
result.returnCode = 0;
@@ -158,6 +166,21 @@ export class Console extends Runner {
158166
}
159167
}
160168

169+
async assertRestoreDevonfwIde(step: Step, command: Command, result: RunResult) {
170+
let installedTools = command.parameters[0];
171+
172+
let assert = new Assertions()
173+
.noErrorCode(result)
174+
.noException(result)
175+
.directoryExits(path.join(this.getWorkingDirectory(), "devonfw", "software"))
176+
.directoryExits(path.join(this.getWorkingDirectory(), "devonfw", "workspaces", "main"));
177+
178+
for(let i = 0; i < installedTools.length; i++) {
179+
if(installedTools[i] == "mvn") installedTools[i] = "maven";
180+
assert.directoryExits(path.join(this.getWorkingDirectory(), "devonfw", "software", installedTools[i]));
181+
}
182+
}
183+
161184
async assertInstallCobiGen(step: Step, command: Command, result: RunResult) {
162185
let assert = new Assertions()
163186
.noErrorCode(result)

0 commit comments

Comments
 (0)