Skip to content
This repository has been archived by the owner on Mar 9, 2023. It is now read-only.

Commit

Permalink
Add support of Win and Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
bellingard committed Oct 22, 2016
1 parent 86984d8 commit 1469e90
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion dist/sonarqube-scanner-executable.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ function getPlatformBinaries(passExecutableCallback) {
// #2 - Download the binaries and unzip them
log("Creating " + installFolder);
mkdirp(installFolder);
var targetOS = "mac";
var targetOS = findTargetOS();
var fileName = "sonarqube-scanner-"
+ targetOS
+ "-x86_64-"
Expand All @@ -95,6 +95,22 @@ function getPlatformBinaries(passExecutableCallback) {
});
}

/*
* Get the target OS based on the platform name
*/
function findTargetOS() {
if (isWindows()) {
return "win";
}
if (isLinux()) {
return "linux";
}
if (isMac()) {
return "mac";
}
throw Error("Your platform " + process.platform + "is currently not supported.")
}

/*
* Some util functions...
*/
Expand Down

0 comments on commit 1469e90

Please sign in to comment.