Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Adjust install script for Windows

  • Loading branch information...
commit 96f3cfaf21c6347cedef5a2e75daae3152369473 1 parent 5ef1136
@janjongboom janjongboom authored
Showing with 6 additions and 3 deletions.
  1. +6 −3 install.js
View
9 install.js
@@ -21,7 +21,7 @@ Are we on Solaris?
function main() {
- var binBasePath = __dirname + "/bin";
+ var binBasePath = PATH.join(__dirname, "/bin");
if (!PATH.existsSync(binBasePath)) {
console.log("Creating directory ", binBasePath);
FS.mkdir(binBasePath, 0755);
@@ -102,15 +102,18 @@ function commandExists(name, callback) {
}
}
+ // win32 not doing which
+ var command = process.platform === "win32" ? "where" : "which";
+
// NOTE: Assuming `which` command exists!
- EXEC("which " + name, function (error, stdout, stderr) {
+ EXEC(command + " " + name, function (error, stdout, stderr) {
if (error || stderr) {
// TODO: Look for `which` command not found error.
callback(null, false);
return;
}
- var path = stdout.replace(/[\r\n\s]*/g, "");
+ var path = stdout.split("\n")[0].trim();
PATH.exists(path, function(exists) {
if (!exists) {
Please sign in to comment.
Something went wrong with that request. Please try again.