Skip to content
Myr

nvm_has

This file

Path

test/fast/Unit tests/nvm_has

12 lines · 361 bytes

Last changed by

[Tests] set `$_` before sourcing `nvm.sh` in fast testsJordan Harbandbefore adoptionc451e7a

History of this file

Take it

1#!/bin/sh23die () { echo "$@" ; exit 1; }45: nvm.sh6\. ../../../nvm.sh78nvm_has cat && type cat > /dev/null || die 'nvm_has locates "cat" properly'910[ "~$(nvm_has foobarbaz 2>&1)" = "~" ] || die "nvm_has does not suppress error output"1112! nvm_has foobarbaz && ! type foobarbaz >/dev/null 2>&1 || die "nvm_has does not return a nonzero exit code when not found"