From b222df04f8c910b5226f433f450a70d3d94d2d77 Mon Sep 17 00:00:00 2001 From: Feon Sua <feonsua@Feons-MacBook-Pro.local> Date: Wed, 27 May 2015 12:10:33 +0800 Subject: [PATCH] [ALOY-1272] Building an alloy project with Titanium CLI on Windows fails --- hooks/alloy.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hooks/alloy.js b/hooks/alloy.js index 902957993..cc0417e8f 100644 --- a/hooks/alloy.js +++ b/hooks/alloy.js @@ -83,6 +83,7 @@ exports.init = function (logger, config, cli, appc) { // we have no clue where alloy is installed, so we're going to subprocess // alloy and hope it's in the system path or a well known place var paths = {}; + var locatorCmd = process.platform === 'win32' ? 'where' : 'which'; parallel(this, ['alloy', 'node'].map(function (bin) { return function (done) { var envName = 'ALLOY_' + (bin === 'node' ? 'NODE_' : '') + 'PATH'; @@ -94,7 +95,7 @@ exports.init = function (logger, config, cli, appc) { paths.alloy = 'alloy.cmd'; done(); } else { - exec('which ' + bin, function (err, stdout, strerr) { + exec(locatorCmd + ' ' + bin, function (err, stdout, strerr) { if (!err) { paths[bin] = stdout.trim(); done();