npm / node-which

Like which(1) unix command. Find the first instance of an executable in the PATH.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Does not support multiple arguments

dzuelke opened this issue · comments

Given multiple arguments, which is supposed to print the location of each match, and return the number of errors as the exit code.

For example:

$ which ls mkdir
/bin/ls
/bin/mkdir
$ echo $?
0
$ which doesnotexist mkdir
/bin/mkdir
$ echo $?
1

However, this package doesn't behave that way:

$ node_modules/.bin/which ls mkdir
/bin/ls
$ echo $?
0
$ node_modules/.bin/which doesnotexist mkdir
not found: doesnotexist
$ echo $?
127

(and then with .node_modules/bin/ on $PATH, Bash stuff that uses which just magically blows up)

Patch welcome to make it behave identical to which(1)!

Fine... see #20 !

Landed on 1.2.0