1
0
mirror of https://github.com/nvm-sh/nvm.git synced 2026-05-17 03:15:39 +08:00
Files
nvm/test/install_script/nvm_reset
2014-10-28 13:47:21 -07:00

30 lines
736 B
Bash
Executable File

#!/bin/sh
cleanup () {
unset -f safe_type
}
die () { echo $@ ; cleanup ; exit 1; }
NVM_ENV=testing . ../../install.sh
safe_type() {
type "$1" > /dev/null 2>&1
}
# Check nvm_reset exists
safe_type nvm_reset || die 'nvm_reset is not available'
# Apply nvm_reset
nvm_reset
# The names should be unset
! safe_type nvm_do_install || die 'nvm_do_install is still available'
! safe_type nvm_has || die 'nvm_has is still available'
! safe_type nvm_download || die 'nvm_download is still available'
! safe_type install_nvm_as_script || die 'install_nvm_as_script is still available'
! safe_type install_nvm_from_git || die 'install_nvm_from_git is still available'
! safe_type nvm_reset || die 'nvm_reset is still available'
cleanup