2014-09-15 23:54:44 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
2016-11-07 03:34:36 +08:00
|
|
|
die () { echo "$@" ; exit 1; }
|
2014-09-15 23:54:44 +08:00
|
|
|
|
2016-11-04 13:15:18 +08:00
|
|
|
\. ../../../nvm.sh
|
2014-09-15 23:54:44 +08:00
|
|
|
|
|
|
|
nvm_has cat && type cat > /dev/null || die 'nvm_has locates "cat" properly'
|
|
|
|
|
|
|
|
[ "~$(nvm_has foobarbaz 2>&1)" = "~" ] || die "nvm_has does not suppress error output"
|
|
|
|
|
|
|
|
! nvm_has foobarbaz && ! type foobarbaz >/dev/null 2>&1 || die "nvm_has does not return a nonzero exit code when not found"
|