Skip to content
Browse files

Merge pull request #8 from c9/windows

Adjust install script for Windows
  • Loading branch information...
2 parents 5ef1136 + 96f3cfa commit 568f40a73a4d2902b730c63a6cc04bee4be14e51 @janjongboom janjongboom committed Dec 29, 2012
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) {

0 comments on commit 568f40a

Please sign in to comment.
Something went wrong with that request. Please try again.