Comparing version 1.2.0 to 1.2.1
@@ -5,3 +5,3 @@ { | ||
"description": "Like which(1) unix command. Find the first instance of an executable in the PATH.", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"repository": { | ||
@@ -8,0 +8,0 @@ "type": "git", |
@@ -32,2 +32,10 @@ # which | ||
## CLI USAGE | ||
Same as the BSD `which(1)` binary. | ||
``` | ||
usage: which [-as] program ... | ||
``` | ||
## OPTIONS | ||
@@ -34,0 +42,0 @@ |
17
which.js
@@ -24,4 +24,4 @@ module.exports = which | ||
var ret = (mod & 1) | ||
|| (mod & U) && process.getgid && gid === process.getgid() | ||
|| (mod & G) && process.getuid && uid === process.getuid() | ||
|| (mod & G) && process.getgid && gid === process.getgid() | ||
|| (mod & U) && process.getuid && uid === process.getuid() | ||
|| (mod & UG) && process.getuid && 0 === process.getuid() | ||
@@ -81,3 +81,8 @@ | ||
} | ||
var p = path.resolve(pathEnv[i], cmd) | ||
var pathPart = pathEnv[i] | ||
if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"') | ||
pathPart = pathPart.slice(1, -1) | ||
var p = path.resolve(pathPart, cmd) | ||
;(function E (ii, ll) { | ||
@@ -110,3 +115,7 @@ if (ii === ll) return F(i + 1, l) | ||
for (var i = 0, l = pathEnv.length; i < l; i ++) { | ||
var p = path.join(pathEnv[i], cmd) | ||
var pathPart = pathEnv[i] | ||
if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"') | ||
pathPart = pathPart.slice(1, -1) | ||
var p = path.join(pathPart, cmd) | ||
for (var j = 0, ll = pathExt.length; j < ll; j ++) { | ||
@@ -113,0 +122,0 @@ var cur = p + pathExt[j] |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12126
305
49