mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-12-13 08:34:19 +00:00
Compare commits
4 Commits
block_iojs
...
submods
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e2f0b5b57c | ||
|
|
207465dd36 | ||
|
|
c30ed0b1d3 | ||
|
|
0e74b147d6 |
@@ -12,8 +12,6 @@ addons:
|
|||||||
git:
|
git:
|
||||||
submodules: false
|
submodules: false
|
||||||
|
|
||||||
group: previous
|
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
ccache: true
|
ccache: true
|
||||||
directories:
|
directories:
|
||||||
@@ -34,7 +32,7 @@ before_install:
|
|||||||
- zsh --version
|
- zsh --version
|
||||||
- dpkg -s dash | grep ^Version | awk '{print $2}'
|
- dpkg -s dash | grep ^Version | awk '{print $2}'
|
||||||
# install python
|
# install python
|
||||||
- pyenv local 2.7.18 || pyenv install 2.7.18
|
- pyenv install 2.7.18
|
||||||
- pyenv local 2.7.18 || echo 'pyenv failed'
|
- pyenv local 2.7.18 || echo 'pyenv failed'
|
||||||
- python -V
|
- python -V
|
||||||
install:
|
install:
|
||||||
|
|||||||
5
nvm.sh
5
nvm.sh
@@ -765,11 +765,6 @@ nvm_remote_versions() {
|
|||||||
NVM_FLAVOR="${NVM_NODE_PREFIX}"
|
NVM_FLAVOR="${NVM_NODE_PREFIX}"
|
||||||
unset PATTERN
|
unset PATTERN
|
||||||
;;
|
;;
|
||||||
*)
|
|
||||||
if [ "${NVM_IOJS_ORG_MIRROR-x}" = '' ]; then
|
|
||||||
NVM_FLAVOR="${NVM_NODE_PREFIX}"
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if nvm_validate_implicit_alias "${PATTERN-}" 2>/dev/null; then
|
if nvm_validate_implicit_alias "${PATTERN-}" 2>/dev/null; then
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
die () { echo "$@" ; cleanup ; exit 1; }
|
die () { echo "$@" ; cleanup ; exit 1; }
|
||||||
|
|
||||||
cleanup() {
|
cleanup() {
|
||||||
unset -f nvm_ls_remote nvm_ls_remote_iojs nvm_ls_remote_node NVM_IOJS_ORG_MIRROR
|
unset -f nvm_ls_remote nvm_ls_remote_iojs
|
||||||
}
|
}
|
||||||
|
|
||||||
\. ../../../nvm.sh
|
\. ../../../nvm.sh
|
||||||
@@ -11,72 +11,67 @@ cleanup() {
|
|||||||
OUTPUT="$(nvm_remote_versions stable 2>&1)"
|
OUTPUT="$(nvm_remote_versions stable 2>&1)"
|
||||||
EXPECTED_OUTPUT="Implicit aliases are not supported in nvm_remote_versions."
|
EXPECTED_OUTPUT="Implicit aliases are not supported in nvm_remote_versions."
|
||||||
EXIT_CODE="$(nvm_remote_versions stable >/dev/null 2>&1; echo $?)"
|
EXIT_CODE="$(nvm_remote_versions stable >/dev/null 2>&1; echo $?)"
|
||||||
[ "_${OUTPUT}" = "_${EXPECTED_OUTPUT}" ] || die "implicit alias 'stable' did not error out with correct message, got ${OUTPUT}"
|
[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] || die "implicit alias 'stable' did not error out with correct message, got $OUTPUT"
|
||||||
[ "_${EXIT_CODE}" = '_1' ] || die "implicit alias 'stable' did not exit with code 1, got ${EXIT_CODE}"
|
[ "_$EXIT_CODE" = "_1" ] || die "implicit alias 'stable' did not exit with code 1, got $EXIT_CODE"
|
||||||
|
|
||||||
OUTPUT="$(nvm_remote_versions unstable 2>&1)"
|
OUTPUT="$(nvm_remote_versions unstable 2>&1)"
|
||||||
EXPECTED_OUTPUT="Implicit aliases are not supported in nvm_remote_versions."
|
EXPECTED_OUTPUT="Implicit aliases are not supported in nvm_remote_versions."
|
||||||
EXIT_CODE="$(nvm_remote_versions unstable >/dev/null 2>&1; echo $?)"
|
EXIT_CODE="$(nvm_remote_versions unstable >/dev/null 2>&1; echo $?)"
|
||||||
[ "_${OUTPUT}" = "_${EXPECTED_OUTPUT}" ] || die "implicit alias 'unstable' did not error out with correct message, got ${OUTPUT}"
|
[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] || die "implicit alias 'unstable' did not error out with correct message, got $OUTPUT"
|
||||||
[ "_${EXIT_CODE}" = '_1' ] || die "implicit alias 'unstable' did not exit with code 1, got ${EXIT_CODE}"
|
[ "_$EXIT_CODE" = "_1" ] || die "implicit alias 'unstable' did not exit with code 1, got $EXIT_CODE"
|
||||||
|
|
||||||
nvm_ls_remote() {
|
nvm_ls_remote() {
|
||||||
echo "N/A"
|
echo "N/A"
|
||||||
}
|
}
|
||||||
OUTPUT="$(nvm_remote_versions foo)"
|
OUTPUT="$(nvm_remote_versions foo)"
|
||||||
EXIT_CODE="$(nvm_remote_versions foo >/dev/null 2>&1 ; echo $?)"
|
EXIT_CODE="$(nvm_remote_versions foo >/dev/null 2>&1 ; echo $?)"
|
||||||
[ "_${OUTPUT}" = "_N/A" ] || die "nonexistent version did not report N/A"
|
[ "_$OUTPUT" = "_N/A" ] || die "nonexistent version did not report N/A"
|
||||||
[ "_${EXIT_CODE}" = '_3' ] || die "nonexistent version did not exit with code 3, got ${EXIT_CODE}"
|
[ "_$EXIT_CODE" = "_3" ] || die "nonexistent version did not exit with code 3, got $EXIT_CODE"
|
||||||
|
|
||||||
nvm_ls_remote_iojs() {
|
nvm_ls_remote_iojs() {
|
||||||
echo "N/A"
|
echo "N/A"
|
||||||
}
|
}
|
||||||
OUTPUT="$(nvm_remote_versions iojs-foo)"
|
OUTPUT="$(nvm_remote_versions iojs-foo)"
|
||||||
EXIT_CODE="$(nvm_remote_versions iojs-foo >/dev/null 2>&1 ; echo $?)"
|
EXIT_CODE="$(nvm_remote_versions iojs-foo >/dev/null 2>&1 ; echo $?)"
|
||||||
[ "_${OUTPUT}" = "_N/A" ] || die "nonexistent version did not report N/A"
|
[ "_$OUTPUT" = "_N/A" ] || die "nonexistent version did not report N/A"
|
||||||
[ "_${EXIT_CODE}" = '_3' ] || die "nonexistent version did not exit with code 3, got ${EXIT_CODE}"
|
[ "_$EXIT_CODE" = "_3" ] || die "nonexistent version did not exit with code 3, got $EXIT_CODE"
|
||||||
|
|
||||||
nvm_ls_remote_node() {
|
|
||||||
|
nvm_ls_remote() {
|
||||||
echo "test output"
|
echo "test output"
|
||||||
echo "more test output"
|
echo "more test output"
|
||||||
echo "pattern received: _${1}_"
|
echo "pattern received: _$1_"
|
||||||
}
|
}
|
||||||
nvm_ls_remote_iojs() {
|
nvm_ls_remote_iojs() {
|
||||||
echo "test iojs output"
|
echo "test iojs output"
|
||||||
echo "more iojs test output"
|
echo "more iojs test output"
|
||||||
echo "iojs pattern received: _${1}_"
|
echo "iojs pattern received: _$1_"
|
||||||
}
|
}
|
||||||
|
|
||||||
OUTPUT="$(nvm_remote_versions foo)"
|
OUTPUT="$(nvm_remote_versions foo)"
|
||||||
EXIT_CODE="$(nvm_remote_versions foo >/dev/null 2>&1 ; echo $?)"
|
EXIT_CODE="$(nvm_remote_versions foo >/dev/null 2>&1 ; echo $?)"
|
||||||
[ "_${OUTPUT}" = "_$(nvm_ls_remote foo)
|
[ "_$OUTPUT" = "_$(nvm_ls_remote foo)
|
||||||
$(nvm_ls_remote_iojs foo)" ] \
|
$(nvm_ls_remote_iojs foo)" ] \
|
||||||
|| die "nvm_remote_versions foo did not return contents of nvm_ls_remote foo combined with nvm_ls_remote_iojs foo; got ${OUTPUT}"
|
|| die "nvm_remote_versions foo did not return contents of nvm_ls_remote foo combined with nvm_ls_remote_iojs foo; got $OUTPUT"
|
||||||
[ "_${EXIT_CODE}" = '_0' ] || die "nvm_remote_versions foo did not exit with 0, got ${EXIT_CODE}"
|
[ "_$EXIT_CODE" = "_0" ] || die "nvm_remote_versions foo did not exit with 0, got $EXIT_CODE"
|
||||||
|
|
||||||
OUTPUT="$(nvm_remote_versions node)"
|
OUTPUT="$(nvm_remote_versions node)"
|
||||||
EXIT_CODE="$(nvm_remote_versions node >/dev/null 2>&1 ; echo $?)"
|
EXIT_CODE="$(nvm_remote_versions node >/dev/null 2>&1 ; echo $?)"
|
||||||
[ "_${OUTPUT}" = "_$(nvm_ls_remote)" ] \
|
[ "_$OUTPUT" = "_$(nvm_ls_remote)" ] \
|
||||||
|| die "nvm_remote_versions node did not return contents of nvm_ls_remote; got ${OUTPUT}"
|
|| die "nvm_remote_versions node did not return contents of nvm_ls_remote; got $OUTPUT"
|
||||||
[ "_${EXIT_CODE}" = '_0' ] || die "nvm_remote_versions node did not exit with 0, got ${EXIT_CODE}"
|
[ "_$EXIT_CODE" = "_0" ] || die "nvm_remote_versions node did not exit with 0, got $EXIT_CODE"
|
||||||
|
|
||||||
OUTPUT="$(nvm_remote_versions iojs-foo)"
|
OUTPUT="$(nvm_remote_versions iojs-foo)"
|
||||||
EXIT_CODE="$(nvm_remote_versions iojs-foo >/dev/null 2>&1 ; echo $?)"
|
EXIT_CODE="$(nvm_remote_versions iojs-foo >/dev/null 2>&1 ; echo $?)"
|
||||||
[ "_${OUTPUT}" = "_$(nvm_ls_remote iojs-foo)
|
[ "_$OUTPUT" = "_$(nvm_ls_remote iojs-foo)
|
||||||
$(nvm_ls_remote_iojs iojs-foo)" ] \
|
$(nvm_ls_remote_iojs iojs-foo)" ] \
|
||||||
|| die "nvm_remote_versions iojs-foo did not return contents of nvm_ls_remote iojs-foo combined with nvm_ls_remote_iojs iojs-foo; got ${OUTPUT}"
|
|| die "nvm_remote_versions iojs-foo did not return contents of nvm_ls_remote iojs-foo combined with nvm_ls_remote_iojs iojs-foo; got $OUTPUT"
|
||||||
[ "_${EXIT_CODE}" = '_0' ] || die "nvm_remote_versions iojs-foo did not exit with 0, got ${EXIT_CODE}"
|
[ "_$EXIT_CODE" = "_0" ] || die "nvm_remote_versions iojs-foo did not exit with 0, got $EXIT_CODE"
|
||||||
|
|
||||||
OUTPUT="$(nvm_remote_versions iojs)"
|
OUTPUT="$(nvm_remote_versions iojs)"
|
||||||
EXIT_CODE="$(nvm_remote_versions iojs >/dev/null 2>&1 ; echo $?)"
|
EXIT_CODE="$(nvm_remote_versions iojs >/dev/null 2>&1 ; echo $?)"
|
||||||
[ "_${OUTPUT}" = "_$(nvm_ls_remote_iojs)" ] \
|
[ "_$OUTPUT" = "_$(nvm_ls_remote_iojs)" ] \
|
||||||
|| die "nvm_remote_versions iojs did not return contents of nvm_ls_remote_iojs; got ${OUTPUT}"
|
|| die "nvm_remote_versions iojs did not return contents of nvm_ls_remote_iojs; got $OUTPUT"
|
||||||
[ "_${EXIT_CODE}" = '_0' ] || die "nvm_remote_versions iojs did not exit with 0, got ${EXIT_CODE}"
|
[ "_$EXIT_CODE" = "_0" ] || die "nvm_remote_versions iojs did not exit with 0, got $EXIT_CODE"
|
||||||
|
|
||||||
OUTPUT="$(NVM_IOJS_ORG_MIRROR= nvm_remote_versions)"
|
|
||||||
EXIT_CODE="$(nvm_remote_versions iojs >/dev/null 2>&1 ; echo $?)"
|
|
||||||
[ "_${OUTPUT}" = "_$(nvm_ls_remote_node)" ] \
|
|
||||||
|| die "NVM_IOJS_ORG_MIRROR= nvm_remote_versions did not return contents of nvm_ls_remote_node; got ${OUTPUT}"
|
|
||||||
[ "_${EXIT_CODE}" = '_0' ] || die "nvm_ls_remote_node= nvm_remote_versions did not exit with 0, got ${EXIT_CODE}"
|
|
||||||
|
|
||||||
cleanup
|
cleanup
|
||||||
|
|||||||
Reference in New Issue
Block a user