cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject [1/2] git commit: CB-6377 Handle spaces in paths for cmd related scripts
Date Mon, 31 Mar 2014 20:14:53 GMT
Repository: cordova-cli
Updated Branches:
  refs/heads/master 640c98ed5 -> 289239daa


CB-6377 Handle spaces in paths for cmd related scripts


Project: http://git-wip-us.apache.org/repos/asf/cordova-cli/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-cli/commit/6ddd9596
Tree: http://git-wip-us.apache.org/repos/asf/cordova-cli/tree/6ddd9596
Diff: http://git-wip-us.apache.org/repos/asf/cordova-cli/diff/6ddd9596

Branch: refs/heads/master
Commit: 6ddd95968fc100c510aaf08eba22472bcf175ea2
Parents: 640c98e
Author: Josh Soref <jsoref@blackberry.com>
Authored: Mon Mar 31 13:39:54 2014 -0400
Committer: Andrew Grieve <agrieve@chromium.org>
Committed: Mon Mar 31 14:53:36 2014 -0400

----------------------------------------------------------------------
 src/superspawn.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6ddd9596/src/superspawn.js
----------------------------------------------------------------------
diff --git a/src/superspawn.js b/src/superspawn.js
index 6c42a7c..12e63f4 100644
--- a/src/superspawn.js
+++ b/src/superspawn.js
@@ -60,11 +60,11 @@ exports.spawn = function(cmd, args, opts) {
     var spawnOpts = {};
     var d = Q.defer();
 
-    if (process.platform.slice(0, 3) == 'win') {
+    if (process.platform == 'win32') {
         cmd = resolveWindowsExe(cmd);
         // If we couldn't find the file, likely we'll end up failing,
         // but for things like "del", cmd will do the trick.
-        if (!fs.existsSync(cmd)) {
+        if (path.extname(cmd) !== 'exe' || !fs.existsSync(cmd)) {
             args = [['/s', '/c', '"'+[cmd].concat(args).map(function(a){if (/^[^"].* .*[^"]/.test(a))
return '"'+a+'"'; return a;}).join(" ")+'"'].join(" ")];
             cmd = 'cmd';
         }


Mime
View raw message