[Tests] `nvm alias --lts`: add tests

Jordan Harband 2016-06-26 15:11:37 -07:00
parent 655830eb58
commit f0668fd577
No known key found for this signature in database
GPG Key ID: 64A196AEE0916D55
3 changed files with 36 additions and 0 deletions

View File

@ -0,0 +1,16 @@
#!/bin/sh
set -ex
. ../../../../nvm.sh
. ../../../common.sh
LTS_ALIAS_PATH="$(nvm_alias_path)/lts"
die () { echo $@ ; exit 1; }
[ ! -d "${LTS_ALIAS_PATH}" ] || die "'${LTS_ALIAS_PATH}' exists and should not"
nvm alias >/dev/null 2>&1
[ -d "${LTS_ALIAS_PATH}" ] || die "'${LTS_ALIAS_PATH}' does not exist and should"

View File

@ -0,0 +1,10 @@
#!/bin/sh
. ../../../../nvm.sh
LTS_ALIAS_PATH="$(nvm_alias_path)/lts"
if [ -d "${LTS_ALIAS_PATH}" ]; then
mv "${LTS_ALIAS_PATH}" "${LTS_ALIAS_PATH}.bak"
rm -rf "${LTS_ALIAS_PATH}"
fi

View File

@ -0,0 +1,10 @@
#!/bin/sh
. ../../../../nvm.sh
LTS_ALIAS_PATH="$(nvm_alias_path)/lts"
if [ -d "${LTS_ALIAS_PATH}.bak" ]; then
rm -rf "${LTS_ALIAS_PATH}"
mv "${LTS_ALIAS_PATH}.bak" "${LTS_ALIAS_PATH}"
fi