diff --git a/Makefile b/Makefile index ddd679e1f14..adb81d61a2a 100644 --- a/Makefile +++ b/Makefile @@ -43,7 +43,7 @@ $(SHELL_TARGETS): @shell='$@'; shell=$${shell##*-}; \ which "$$shell" >/dev/null || { printf '\033[0;31m%s\033[0m\n' "WARNING: Cannot test with shell '$$shell': not found." >&2; exit 0; } && \ printf '\n\033[0;34m%s\033[0m\n' "Running tests in $$shell"; \ - [ -z "$$TRAVIS_BUILD_DIR" ] && for v in $$(set | awk -F'=' '$$1 ~ "^NVM_" { print $$1 }'); do unset $$v; done && unset v; \ + [ -z "$$TRAVIS_BUILD_DIR" ] && [ -z "$$GITHUB_ACTIONS" ] && for v in $$(set | awk -F'=' '$$1 ~ "^NVM_" { print $$1 }'); do unset $$v; done && unset v; \ for suite in $(TEST_SUITE); do \ echo "Running test suite: $$suite"; \ $(URCHIN) -f -s $$shell test/$$suite || exit; \ diff --git a/test/sourcing/Sourcing nvm.sh should keep version if one is active b/test/sourcing/Sourcing nvm.sh should keep version if one is active index 28f39c883ca..dbfcafb23cd 100755 --- a/test/sourcing/Sourcing nvm.sh should keep version if one is active +++ b/test/sourcing/Sourcing nvm.sh should keep version if one is active @@ -1,6 +1,6 @@ #!/bin/sh -die () { echo "$@" ; exit 1; } +die () { echo "$*" ; echo "|${NVM_DIR}|"; exit 1; } echo '0.10.1' > ../../alias/default || die "couldn't create default alias" diff --git a/test/sourcing/Sourcing nvm.sh with --install and .nvmrc should install it b/test/sourcing/Sourcing nvm.sh with --install and .nvmrc should install it index e40e5c1c88e..dff170ca49a 100755 --- a/test/sourcing/Sourcing nvm.sh with --install and .nvmrc should install it +++ b/test/sourcing/Sourcing nvm.sh with --install and .nvmrc should install it @@ -1,6 +1,7 @@ #!/bin/sh -die () { rm .nvmrc ; echo "$*" ; exit 1; } +die () { echo "$*" ; echo "|${NVM_DIR}|"; exit 1; } + supports_source_options () { [ "_$(echo 'echo $1' | . /dev/stdin yes)" = "_yes" ] } @@ -12,15 +13,24 @@ fi echo '0.10.2' > .nvmrc || die 'creation of .nvmrc failed' +export NVM_DIR="${PWD}/../.." +rm ../../alias/default + \. ../../nvm.sh --install EXIT_CODE="$?" echo 'sourcing complete.' -nvm_version 0.10.2 >/dev/null 2>&1 || die "v0.10.2 not installed: \n$(nvm_ls)" - [ "_$(nvm_rc_version | \grep -o -e 'with version .*$')" = "_with version <0.10.2>" ] || die "nvm_rc_version $(nvm_rc_version)" +echo "|${NVM_DIR}|" +nvm alias +echo default: "$(nvm_alias default)" +nvm_find_nvmrc +pwd + +nvm_version 0.10.2 >/dev/null 2>&1 || die "v0.10.2 not installed: \n$(nvm_ls)" + [ "_${EXIT_CODE}" = '_0' ] || die "sourcing returned nonzero exit code: ${EXIT_CODE}" NVM_LS_CURRENT="$(nvm ls current | \grep -o v0.10.2)" diff --git a/test/sourcing/Sourcing nvm.sh with --install should install the default b/test/sourcing/Sourcing nvm.sh with --install should install the default index 0f71d48bcfe..6b1909f7fe6 100755 --- a/test/sourcing/Sourcing nvm.sh with --install should install the default +++ b/test/sourcing/Sourcing nvm.sh with --install should install the default @@ -2,6 +2,7 @@ \. ../common.sh die () { echo "$@" ; exit 1; } + supports_source_options () { [ "_$(echo 'echo $1' | . /dev/stdin yes)" = "_yes" ] } @@ -11,6 +12,7 @@ if ! supports_source_options; then exit 0; fi +rm .nvmrc echo '0.10.2' > ../../alias/default || die 'creation of default alias failed' echo 'sourcing nvm with --install...' @@ -20,6 +22,8 @@ EXIT_CODE="$?" echo 'sourcing complete.' +[ "$(nvm_alias default)" = '0.10.2' ] || die "nvm_alias default did not return '0.10.2', got >$(nvm_alias default)<" + nvm_version 0.10.2 >/dev/null 2>&1 || die "v0.10.2 not installed: \n$(nvm_ls)" [ "_$EXIT_CODE" = '_0' ] || die "sourcing returned nonzero exit code: ${EXIT_CODE}"