Skip to content
This repository has been archived by the owner on Apr 6, 2021. It is now read-only.

Commit

Permalink
Adjust install script for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
janjongboom committed Dec 29, 2012
1 parent 5ef1136 commit 96f3cfa
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions install.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 96f3cfa

Please sign in to comment.