You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2014/04/02 05:09:34 UTC

git commit: CB-6377 Remove windowsVerbatimArguments from superspawn

Repository: cordova-cli
Updated Branches:
  refs/heads/master 5cf9d9064 -> 630cf6b95


CB-6377 Remove windowsVerbatimArguments from superspawn

It messes up when cmd has a space in it.
This also fixes the previous CB-6377 commit (which I accidentally
pushed), where all paths on windows were going through the "cmd /s /c"
crutch.

close #155


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

Branch: refs/heads/master
Commit: 630cf6b953aacb8d6d5f1b9202777140978ade87
Parents: 5cf9d90
Author: Andrew Grieve <ag...@chromium.org>
Authored: Tue Apr 1 23:07:25 2014 -0400
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Tue Apr 1 23:07:25 2014 -0400

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


http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/630cf6b9/src/superspawn.js
----------------------------------------------------------------------
diff --git a/src/superspawn.js b/src/superspawn.js
index 12e63f4..9ae27f2 100644
--- a/src/superspawn.js
+++ b/src/superspawn.js
@@ -64,11 +64,11 @@ exports.spawn = function(cmd, args, opts) {
         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 (path.extname(cmd) !== 'exe' || !fs.existsSync(cmd)) {
+        if (!fs.existsSync(cmd)) {
+            // We need to use /s to ensure that spaces are parsed properly with cmd spawned content
             args = [['/s', '/c', '"'+[cmd].concat(args).map(function(a){if (/^[^"].* .*[^"]/.test(a)) return '"'+a+'"'; return a;}).join(" ")+'"'].join(" ")];
             cmd = 'cmd';
         }
-        spawnOpts.windowsVerbatimArguments = true;
     }
 
     if (opts.stdio == 'ignore') {