From 19288e279b5ac849e3361e20f6e8bb0269b36ae6 Mon Sep 17 00:00:00 2001 From: Xandor Schiefer Date: Wed, 16 Nov 2016 07:48:45 +0200 Subject: [PATCH] nvm's paths aren't always in the same place in PATH anymore --- ...\" should unset the nvm environment variables." | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git "a/test/fast/Running \"nvm deactivate\" should unset the nvm environment variables." "b/test/fast/Running \"nvm deactivate\" should unset the nvm environment variables." index af9ecef..3eb1b3f 100755 --- "a/test/fast/Running \"nvm deactivate\" should unset the nvm environment variables." +++ "b/test/fast/Running \"nvm deactivate\" should unset the nvm environment variables." @@ -6,19 +6,19 @@ mkdir -p ../../v0.2.3 die () { echo "$@" ; exit 1; } -[ `expr $PATH : ".*v0.2.3/.*/bin"` = 0 ] || echo "WARNING: Unexpectedly found v0.2.3 already active" >&2 +[ `expr $PATH : ".*v0.2.3/.*/bin.*"` = 0 ] || echo "WARNING: Unexpectedly found v0.2.3 already active" >&2 \. ../../nvm.sh nvm use --delete-prefix v0.2.3 || die "Failed to activate v0.2.3" -[ `expr "$PATH" : ".*v0.2.3/.*/bin"` != 0 ] || die "PATH not set up properly" -[ `expr "$NODE_PATH" : ".*v0.2.3/.*/lib/node_modules"` = 0 ] || die "NODE_PATH should not contain (npm root -g)" -[ `expr "$NVM_BIN" : ".*v0.2.3/bin"` != 0 ] || die "NODE_BIN should contain bin directory path" -[ `expr "$NVM_PATH" : ".*v0.2.3/lib/node"` != 0 ] || die "NODE_PATH should contain lib node directory path" +[ `expr "$PATH" : ".*v0.2.3/.*/bin.*"` != 0 ] || die "PATH not set up properly" +[ `expr "$NODE_PATH" : ".*v0.2.3/.*/lib/node_modules.*"` = 0 ] || die "NODE_PATH should not contain (npm root -g)" +[ `expr "$NVM_BIN" : ".*v0.2.3/bin.*"` != 0 ] || die "NODE_BIN should contain bin directory path" +[ `expr "$NVM_PATH" : ".*v0.2.3/lib/node.*"` != 0 ] || die "NODE_PATH should contain lib node directory path" # ^ note: NODE_PATH should not contain `npm root -g` since globals should not be requireable nvm deactivate || die "Failed to deactivate v0.2.3" -[ `expr "$PATH" : ".*v0.2.3/.*/bin"` = 0 ] || die "PATH not cleaned properly" -[ `expr "$NODE_PATH" : ".*v0.2.3/.*/lib/node_modules"` = 0 ] || die "NODE_PATH not cleaned properly" +[ `expr "$PATH" : ".*v0.2.3/.*/bin.*"` = 0 ] || die "PATH not cleaned properly" +[ `expr "$NODE_PATH" : ".*v0.2.3/.*/lib/node_modules.*"` = 0 ] || die "NODE_PATH not cleaned properly" [ "_$NVM_BIN" = "_" ] || die "NVM_BIN should be unset: got '$NVM_BIN'" [ "_$NVM_PATH" = "_" ] || die "NVM_PATH should be unset: got '$NVM_PATH'"