[Tests] add `nvm_grep` to install script, fix tests

nmarghetti 2021-01-08 18:54:40 +01:00 committed by Jordan Harband
parent 436cda247e
commit 9f3397afa4
No known key found for this signature in database
GPG Key ID: 9F6A681E35EF8B56
2 changed files with 7 additions and 1 deletions

View File

@ -6,6 +6,10 @@ nvm_has() {
type "$1" > /dev/null 2>&1 type "$1" > /dev/null 2>&1
} }
nvm_grep() {
GREP_OPTIONS='' command grep "$@"
}
nvm_default_install_dir() { nvm_default_install_dir() {
[ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm" [ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm"
} }
@ -423,7 +427,7 @@ nvm_reset() {
unset -f nvm_has nvm_install_dir nvm_latest_version nvm_profile_is_bash_or_zsh \ unset -f nvm_has nvm_install_dir nvm_latest_version nvm_profile_is_bash_or_zsh \
nvm_source nvm_node_version nvm_download install_nvm_from_git nvm_install_node \ nvm_source nvm_node_version nvm_download install_nvm_from_git nvm_install_node \
install_nvm_as_script nvm_try_profile nvm_detect_profile nvm_check_global_modules \ install_nvm_as_script nvm_try_profile nvm_detect_profile nvm_check_global_modules \
nvm_do_install nvm_reset nvm_default_install_dir nvm_do_install nvm_reset nvm_default_install_dir nvm_grep
} }
[ "_$NVM_ENV" = "_testing" ] || nvm_do_install [ "_$NVM_ENV" = "_testing" ] || nvm_do_install

View File

@ -6,5 +6,7 @@ die () { echo "$@" ; exit 1; }
unset NVM_DIR unset NVM_DIR
NODE_VERSION=8 \. ../../install.sh NODE_VERSION=8 \. ../../install.sh
. "${NVM_DIR}/nvm.sh"
# nvm installed node 8 # nvm installed node 8
nvm ls 8 > /dev/null 2>&1 || die "nvm didn't install node 8" nvm ls 8 > /dev/null 2>&1 || die "nvm didn't install node 8"