Clean up after existing `nvm install` tests.

master
Jordan Harband 2014-04-19 16:48:14 -07:00
parent 55a6f1f06e
commit eb6031cb58
5 changed files with 38 additions and 17 deletions

View File

@ -1,16 +1,17 @@
#!/bin/sh #!/bin/sh
set -e set -e
. ../../nvm.sh . ../../../nvm.sh
VERSION=v0.10.7 NVM_TEST_VERSION=v0.10.7
# Remove the stuff we're clobbering. # Remove the stuff we're clobbering.
[ -e ../../$VERSION ] && rm -R ../../$VERSION [ -e ../../../$NVM_TEST_VERSION ] && rm -R ../../../$NVM_TEST_VERSION
# Install from binary # Install from binary
nvm install $VERSION nvm install $NVM_TEST_VERSION
# Check # Check
[ -d ../../$VERSION ] [ -d ../../../$NVM_TEST_VERSION ]
nvm run $VERSION --version | grep $VERSION nvm run $NVM_TEST_VERSION --version | grep $NVM_TEST_VERSION

View File

@ -1,16 +1,17 @@
#!/bin/sh #!/bin/sh
set -e set -e
. ../../nvm.sh . ../../../nvm.sh
VERSION=v0.10.7 NVM_TEST_VERSION=v0.10.7
# Remove the stuff we're clobbering. # Remove the stuff we're clobbering.
[ -e ../../$VERSION ] && rm -R ../../$VERSION [ -e ../../../$NVM_TEST_VERSION ] && rm -R ../../../$NVM_TEST_VERSION
# Install from source # Install from source
nvm install -s $VERSION nvm install -s $NVM_TEST_VERSION
# Check # Check
[ -d ../../$VERSION ] [ -d ../../../$NVM_TEST_VERSION ]
nvm run $VERSION --version | grep $VERSION nvm run $NVM_TEST_VERSION --version | grep $NVM_TEST_VERSION

View File

@ -1,19 +1,19 @@
#!/bin/sh #!/bin/sh
set -e set -e
. ../../nvm.sh . ../../../nvm.sh
# Remove the stuff we're clobbering. # Remove the stuff we're clobbering.
[ -e ../../v0.10.7 ] && rm -R ../../v0.10.7 [ -e ../../../v0.10.7 ] && rm -R ../../../v0.10.7
[ -e ../../v0.10.8 ] && rm -R ../../v0.10.8 [ -e ../../../v0.10.8 ] && rm -R ../../../v0.10.8
# Install from binary # Install from binary
nvm install 0.10.7 nvm install 0.10.7
nvm install 0.10.8 nvm install 0.10.8
# Check # Check
[ -d ../../v0.10.7 ] [ -d ../../../v0.10.7 ]
[ -d ../../v0.10.8 ] [ -d ../../../v0.10.8 ]
# Use the first one # Use the first one
nvm use 0.10.7 nvm use 0.10.7

View File

@ -0,0 +1,6 @@
#!/bin/sh
if [ -f ".nvmrc" ]; then
mv .nvmrc .nvmrc.bak
fi

View File

@ -0,0 +1,13 @@
#!/bin/sh
. ../../../nvm.sh
nvm uninstall v0.10.7
if [ -f ".nvmrc" ]; then
rm .nvmrc
fi
if [ -f ".nvmrc.bak" ]; then
mv .nvmrc.bak .nvmrc
fi