Skip to content
Myr

[Fix] `install.sh`: fix failing install tests (#3458)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by menaechmi · committed by Jordan Harband · parent 3de0b15 · Browse files · 2 files+5 added−5 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+5 added−5 removed

  • tests:+4 added−4 removed
  • other:+1 added−1 removed

2 files+5 added−5 removed

modified:test/install_script/nvm_detect_profile+4 added-4 removed
21 unmodified lines
22 unset SHELL23 unset -f setup cleanup die24 unset ZDOTDIR25 rm -f ".bashrc" ".bash_profile" ".zprofile" ".zshrc" ".profile" "test_profile" > "/dev/null" 2>&126 rm -rf zdot>&126 rm -rf zdotdir 2>&127}2829die () { echo "$@" '$NVM_DETECT_PROFILE:' "$NVM_DETECT_PROFILE"; cleanup; exit 1; }30
62 unmodified lines
93# return an empty value if everything fails94#9596# It should favor .profile if file exists97NVM_DETECT_PROFILE="$(unset SHELL; nvm_detect_profile)"97NVM_DETECT_PROFILE="$(unset SHELL; unset ZDOTDIR; nvm_detect_profile)"98if [ "$NVM_DETECT_PROFILE" != "$HOME/.profile" ]; then99 die "nvm_detect_profile should have selected .profile"100fi101102# Otherwise, it should favor .bashrc if file exists103rm ".profile"104NVM_DETECT_PROFILE="$(unset SHELL; nvm_detect_profile)"104NVM_DETECT_PROFILE="$(unset SHELL; unset ZDOTDIR; nvm_detect_profile)"105if [ "$NVM_DETECT_PROFILE" != "$HOME/.bashrc" ]; then106 die "nvm_detect_profile should have selected .bashrc"107fi108109# Otherwise, it should favor .bash_profile if file exists110rm ".bashrc"111NVM_DETECT_PROFILE="$(unset SHELL; nvm_detect_profile)"111NVM_DETECT_PROFILE="$(unset SHELL; unset ZDOTDIR; nvm_detect_profile)"112if [ "$NVM_DETECT_PROFILE" != "$HOME/.bash_profile" ]; then113 die "nvm_detect_profile should have selected .bash_profile"114fi115
36 unmodified lines
modified:install.sh+1 added-1 removed
304 unmodified lines
305306 if [ -z "$DETECTED_PROFILE" ]; then307 for EACH_PROFILE in ".profile" ".bashrc" ".bash_profile" ".zprofile" ".zshrc"308 do309 if DETECTED_PROFILE="$(nvm_try_profile "${HOME}/${EACH_PROFILE}")"; then309 if DETECTED_PROFILE="$(nvm_try_profile "${ZDOTDIR:-${HOME}}/${EACH_PROFILE}")"; then310 break311 fi312 done313 fi
182 unmodified lines