Github user jasongin commented on a diff in the pull request:
https://github.com/apache/cordova-lib/pull/434#discussion_r62252220
--- Diff: cordova-common/src/superspawn.js ---
@@ -22,20 +22,20 @@ var fs = require('fs');
var path = require('path');
var _ = require('underscore');
var Q = require('q');
-var shell = require('shelljs');
var events = require('./events');
var iswin32 = process.platform == 'win32';
// On Windows, spawn() for batch files requires absolute path & having the
extension.
function resolveWindowsExe(cmd) {
+ var which = require('shelljs/src/which');
var winExtensions = ['.exe', '.bat', '.cmd', '.js', '.vbs'];
function isValidExe(c) {
return winExtensions.indexOf(path.extname(c)) !== -1 &&
fs.existsSync(c);
}
if (isValidExe(cmd)) {
return cmd;
}
- cmd = shell.which(cmd) || cmd;
+ cmd = which({}, cmd) || cmd;
if (!isValidExe(cmd)) {
--- End diff --
I think this won't work now. The non-wrapped `which()` returns a
`ShellString` object, then `path.extname()` throws if `(typeof path !==
'string')`.
Did you test on Windows?
---
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.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]