2021-01-13 09:26:38 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
cleanup () {
|
|
|
|
unset -f die cleanup
|
|
|
|
}
|
|
|
|
die () { echo "$@" ; cleanup ; exit 1; }
|
|
|
|
|
|
|
|
NVM_ENV=testing \. ../../install.sh
|
|
|
|
|
|
|
|
# nvm_download install.sh
|
2022-12-24 04:53:40 +08:00
|
|
|
nvm_download "https://raw.githubusercontent.com/nvm-sh/nvm/HEAD/install.sh" >/dev/null || die "nvm_download unable to download install.sh"
|
2021-01-13 09:26:38 +08:00
|
|
|
|
|
|
|
# nvm_download should fail to download wrong_install.sh
|
2022-12-24 04:53:40 +08:00
|
|
|
if nvm_download "https://raw.githubusercontent.com/nvm-sh/nvm/HEAD/wrong_install.sh" &>/dev/null; then
|
2021-01-13 09:26:38 +08:00
|
|
|
die "nvm_download should fail to download no existing file"
|
|
|
|
fi
|
|
|
|
|
|
|
|
cleanup
|