Browse Source

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

nmarghetti 4 years ago committed by Jordan Harband
parent
commit
9f3397afa4
No known key found for this signature in database
GPG Key ID: 9F6A681E35EF8B56
  1. 6
      install.sh
  2. 2
      test/install_script/nvm_install_with_node_version

6
install.sh

@ -6,6 +6,10 @@ nvm_has() { @@ -6,6 +6,10 @@ nvm_has() {
type "$1" > /dev/null 2>&1
}
nvm_grep() {
GREP_OPTIONS='' command grep "$@"
}
nvm_default_install_dir() {
[ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm"
}
@ -423,7 +427,7 @@ nvm_reset() { @@ -423,7 +427,7 @@ nvm_reset() {
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 \
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

2
test/install_script/nvm_install_with_node_version

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

Loading…
Cancel
Save