cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject android commit: CB-5801 Add spawn work-around on windows for it not being able to execute .cmd files
Date Thu, 16 Jan 2014 17:12:32 GMT
Updated Branches:
  refs/heads/master 4971670e5 -> 22e403913


CB-5801 Add spawn work-around on windows for it not being able to execute .cmd files

More info: https://github.com/joyent/node/issues/2318


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

Branch: refs/heads/master
Commit: 22e4039133470aea7802ff66636dd5839c4d4790
Parents: 4971670
Author: Andrew Grieve <agrieve@chromium.org>
Authored: Thu Jan 16 12:11:31 2014 -0500
Committer: Andrew Grieve <agrieve@chromium.org>
Committed: Thu Jan 16 12:11:31 2014 -0500

----------------------------------------------------------------------
 bin/templates/cordova/lib/spawn.js | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/22e40391/bin/templates/cordova/lib/spawn.js
----------------------------------------------------------------------
diff --git a/bin/templates/cordova/lib/spawn.js b/bin/templates/cordova/lib/spawn.js
index cea7a06..d5b0dce 100644
--- a/bin/templates/cordova/lib/spawn.js
+++ b/bin/templates/cordova/lib/spawn.js
@@ -21,11 +21,17 @@
 
 var child_process = require('child_process'),
     Q       = require('q');
+var isWindows = process.platform.slice(0, 3) == 'win';
 
 // Takes a command and optional current working directory.
 module.exports = function(cmd, args, opt_cwd) {
     var d = Q.defer();
     try {
+        // Work around spawn not being able to find .bat files.
+        if (isWindows) {
+          args.unshift('/s', '/c', cmd);
+          cmd = 'cmd';
+        }
         var child = child_process.spawn(cmd, args, {cwd: opt_cwd, stdio: 'inherit'});
         child.on('exit', function(code) {
             if (code) {


Mime
View raw message