aboutsummaryrefslogtreecommitdiff
path: root/node_modules/shelljs/src/which.js
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2017-08-14 05:01:11 +0200
committerFlorian Dold <florian.dold@gmail.com>2017-08-14 05:02:09 +0200
commit363723fc84f7b8477592e0105aeb331ec9a017af (patch)
tree29f92724f34131bac64d6a318dd7e30612e631c7 /node_modules/shelljs/src/which.js
parent5634e77ad96bfe1818f6b6ee70b7379652e5487f (diff)
downloadwallet-core-363723fc84f7b8477592e0105aeb331ec9a017af.tar.xz
node_modules
Diffstat (limited to 'node_modules/shelljs/src/which.js')
-rw-r--r--node_modules/shelljs/src/which.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/node_modules/shelljs/src/which.js b/node_modules/shelljs/src/which.js
index 03db57bcd..a5f9e15eb 100644
--- a/node_modules/shelljs/src/which.js
+++ b/node_modules/shelljs/src/which.js
@@ -37,6 +37,7 @@ function checkPath(pathName) {
function _which(options, cmd) {
if (!cmd) common.error('must specify command');
+ var isWindows = process.platform === 'win32';
var pathEnv = process.env.path || process.env.Path || process.env.PATH;
var pathArray = splitPath(pathEnv);
@@ -47,7 +48,7 @@ function _which(options, cmd) {
// Assume that there are no extensions to append to queries (this is the
// case for unix)
var pathExtArray = [''];
- if (common.platform === 'win') {
+ if (isWindows) {
// In case the PATHEXT variable is somehow not set (e.g.
// child_process.spawn with an empty environment), use the XP default.
var pathExtEnv = process.env.PATHEXT || XP_DEFAULT_PATHEXT;
@@ -61,7 +62,7 @@ function _which(options, cmd) {
var attempt = path.resolve(pathArray[k], cmd);
- if (common.platform === 'win') {
+ if (isWindows) {
attempt = attempt.toUpperCase();
}