You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
555 B

10 years ago
#!/bin/sh
cleanup () {
unset -f die cleanup
unset install_dir
}
die () { echo "$@" ; cleanup ; exit 1; }
10 years ago
NVM_ENV=testing \. ../../install.sh
10 years ago
HOME="__home__"
# NVM_DIR is set
NVM_DIR="some_dir"
install_dir=$(nvm_install_dir)
[ "_$install_dir" = "_$NVM_DIR" ] || die "nvm_install_dir should use \$NVM_DIR if it exists. Current output: $install_dir"
unset NVM_DIR
# NVM_DIR is not set
install_dir=$(nvm_install_dir)
[ "_$install_dir" = "_$HOME/.nvm" ] || die "nvm_install_dir should default to \$HOME/.nvm. Current output: $install_dir"
10 years ago
cleanup