Skip to content

Commit 6144899

Browse files
authored
Merge pull request #44 from GuentherJulian/feature/consoleDevonIdeVersionable
feature/installation of devonfw ide versionable
2 parents 041d8b3 + 99f18dd commit 6144899

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

documentation/Functions.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@ The following functions are already implemented:
77

88
***
99

10-
### installDevonIde
10+
### installDevonfwIde
1111
#### parameter
1212
1. The tools you want to install within the devonfw ide: string array
13+
2. Optional: The version of the ide to install
1314
#### example
14-
installDevonfwIde(["java","mvn"])
15+
installDevonfwIde(["java","mvn"], "2020.08.001")
1516

1617
***
1718

runners/console/index.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,16 @@ export class Console extends Runner {
3636
let installDir = path.join(this.getWorkingDirectory(), "devonfw");
3737
this.createFolder(installDir, true);
3838

39+
let downloadUrl = "https://bit.ly/2BCkFa9";
40+
if(command.parameters.length > 1 && command.parameters[1] != "") {
41+
downloadUrl = "https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=com.devonfw.tools.ide&a=devonfw-ide-scripts&p=tar.gz&v=" + command.parameters[1];
42+
}
3943
if(this.platform == ConsolePlatform.WINDOWS) {
40-
this.executeCommandSync("powershell.exe Invoke-WebRequest -OutFile devonfw.tar.gz https://bit.ly/2BCkFa9", installDir, result);
44+
this.executeCommandSync("powershell.exe \"Invoke-WebRequest -OutFile devonfw.tar.gz '" + downloadUrl + "'\"", installDir, result);
4145
this.executeCommandSync("powershell.exe tar -xvzf devonfw.tar.gz", installDir, result);
4246
this.executeCommandSync("powershell.exe ./setup " + path.join(settingsDir, "settings.git").replace(/\\/g, "/"), installDir, result, "yes");
4347
} else {
44-
this.executeCommandSync("wget -c https://bit.ly/2BCkFa9 -O - | tar -xz", installDir, result);
48+
this.executeCommandSync("wget -c \"" + downloadUrl + "\" -O - | tar -xz", installDir, result);
4549
this.executeCommandSync("bash setup " + path.join(settingsDir, "settings.git").replace(/\\/g, "/"), installDir, result, "yes");
4650
}
4751

0 commit comments

Comments
 (0)