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
set -e
. ../../nvm.sh
. ../../../nvm.sh
VERSION=v0.10.7
NVM_TEST_VERSION=v0.10.7
# Remove the stuff we're clobbering.
[ -e ../../$VERSION ] && rm -R ../../$VERSION
[ -e ../../../$NVM_TEST_VERSION ] && rm -R ../../../$NVM_TEST_VERSION
# Install from binary
nvm install $VERSION
nvm install $NVM_TEST_VERSION
# Check
[ -d ../../$VERSION ]
nvm run $VERSION --version | grep $VERSION
[ -d ../../../$NVM_TEST_VERSION ]
nvm run $NVM_TEST_VERSION --version | grep $NVM_TEST_VERSION

View File

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

View File

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