Github user agrieve commented on a diff in the pull request:
https://github.com/apache/cordova-cli/pull/155#discussion_r11130975
--- Diff: src/superspawn.js ---
@@ -60,11 +60,11 @@ exports.spawn = function(cmd, args, opts) {
var spawnOpts = {};
var d = Q.defer();
- if (process.platform.slice(0, 3) == 'win') {
+ if (process.platform == 'win32') {
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 (!fs.existsSync(cmd)) {
+ if (path.extname(cmd) !== 'exe' || !fs.existsSync(cmd)) {
--- End diff --
extname returns ".exe", so this is just using cmd always.
I tested that spawn executes .bat / .cmd files so long as you use the full
path to them.
Could you add in a comment saying why we'd want to go through cmd anyways
(it fixes the arg parsing?)
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---