Fix which error when either node or nodejs is missing

This commit is contained in:
Justin Dray 2016-02-08 18:56:14 +10:00
parent 737d03271f
commit 1ef7fd0aa5

View File

@ -22,7 +22,7 @@ _b9_init_nodejs() {
local NODEJS
. ~/.nvm/nvm.sh &> /dev/null || :
for NODEJS in $(which node) $(which nodejs) /usr/local/bin/node /usr/bin/nodejs; do
for NODEJS in $(which node 2>/dev/null) $(which nodejs 2>/dev/null) /usr/local/bin/node /usr/bin/nodejs; do
[ -x $NODEJS ] && break
NODEJS=""
done
@ -62,4 +62,4 @@ _b9_init_node_helper() {
rm -rf node_modules
$NPM install
popd &> /dev/null
}
}