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-6306 Error creating project when path to project includes spaces
Date Fri, 21 Mar 2014 23:47:24 GMT
Repository: cordova-cli
Updated Branches:
  refs/heads/master 79e571953 -> bc4422b62


CB-6306 Error creating project when path to project includes spaces

github: close #143


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

Branch: refs/heads/master
Commit: bc4422b620e0ad92b7edd041a9a1093d61ef9bd7
Parents: 6e560ae
Author: Josh Soref <jsoref@blackberry.com>
Authored: Tue Mar 18 18:06:27 2014 -0400
Committer: Andrew Grieve <agrieve@chromium.org>
Committed: Fri Mar 21 16:47:11 2014 -0700

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


http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/bc4422b6/src/superspawn.js
----------------------------------------------------------------------
diff --git a/src/superspawn.js b/src/superspawn.js
index 5491be3..7fce47e 100644
--- a/src/superspawn.js
+++ b/src/superspawn.js
@@ -52,18 +52,19 @@ function resolvePath(cmd) {
 exports.spawn = function(cmd, args, opts) {
     args = args || [];
     opts = opts || {};
+    var spawnOpts = {};
     var d = Q.defer();
     if (process.platform.slice(0, 3) == 'win') {
         cmd = resolvePath(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.exists(cmd)) {
-            args = ['/c', cmd].concat(args);
+            args = [['/s', '/c', '"'+[cmd].concat(args).map(function(a){if (/^[^"].* .*[^"]/.test(a))
return '"'+a+'"'; return a;}).join(" ")+'"'].join(" ")];
             cmd = 'cmd';
         }
+        spawnOpts.windowsVerbatimArguments = true;
     }
 
-    var spawnOpts = {};
     if (opts.stdio == 'ignore') {
         spawnOpts.stdio = 'ignore';
     } else if (opts.stdio == 'inherit') {


Mime
View raw message