mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-26 12:03:28 +08:00
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
This commit is contained in:
parent
4971670e56
commit
22e4039133
6
bin/templates/cordova/lib/spawn.js
vendored
6
bin/templates/cordova/lib/spawn.js
vendored
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user