cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From na...@apache.org
Subject [15/33] git commit: CB-5801 Add spawn work-around on windows for it not being able to execute .cmd files
Date Mon, 03 Feb 2014 18:37:28 GMT
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-amazon-fireos/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/commit/5a0a8ab6
Tree: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/tree/5a0a8ab6
Diff: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/diff/5a0a8ab6

Branch: refs/heads/master
Commit: 5a0a8ab6f8a95fb1608e9d619769cc52bc9df9d8
Parents: acf8a56
Author: Andrew Grieve <agrieve@chromium.org>
Authored: Thu Jan 16 12:11:31 2014 -0500
Committer: Archana Naik <naika@lab126.com>
Committed: Fri Jan 31 14:59:59 2014 -0800

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


http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/5a0a8ab6/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