Compare commits

..

7 Commits

Author SHA1 Message Date
Jordan Harband
4ba96c5974 [actions] migrate Travis CI tests to GitHub Actions
Some checks failed
Tests on Windows: `nvm install` / WSL nvm install (script, 12, Debian) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 12, Alpine) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 12, Ubuntu-18.04) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 12, Ubuntu-20.04) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 14, Debian) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 14, Ubuntu-18.04) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 14, Ubuntu-20.04) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 16, Debian) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 16, Ubuntu-18.04) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 16, Ubuntu-20.04) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 18, Debian) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 18, Ubuntu-20.04) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 21, Debian) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 21, Ubuntu-20.04) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (, --lts, Alpine) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (, 10, Alpine) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (, 11, Alpine) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (, 12, Alpine) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (, 14, Alpine) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (, 16, Alpine) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (, 18, Alpine) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (, 21, Alpine) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, --lts, Alpine) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 10, Alpine) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 11, Alpine) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 14, Alpine) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 16, Alpine) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 18, Alpine) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 21, Alpine) (push) Has been cancelled
Tests on Windows: `nvm install` / tests, on windows (push) Has been cancelled
2026-01-26 23:12:24 -08:00
Jordan Harband
b07eb5051a [Tests] mock node in nvm_die_on_prefix test 2026-01-26 22:34:24 -08:00
Jordan Harband
7827187fc0 [Tests] clean up .nvmrc after nvm-exec test 2026-01-26 22:34:07 -08:00
Jordan Harband
1d29998546 [Tests] set $_ before sourcing nvm.sh in fast tests
nvm.sh uses `NVM_SCRIPT_SOURCE="$_"` to detect its source location.
Adding `: nvm.sh` before each source line ensures `$_` is set correctly, preventing breakage when the previous command (e.g., `set -ex`) overwrites it.
2026-01-26 21:41:57 -08:00
Jordan Harband
faa8585c6f [Fix] nvm_strip_path: avoid gawk-specific RT variable for mawk compatibility 2026-01-26 22:33:58 -08:00
Jordan Harband
92e0ec2ac2 [Fix] nvm_get_default_packages: use portable awk patterns
Replace POSIX `[[:space:]]` character class with `[ \t]` for
mawk compatibility on Ubuntu 16.04.
2026-01-26 16:59:11 -08:00
Jordan Harband
f05be89217 [Fix] nvm_install_source: explicitly set SHELL=/bin/sh for make
Old Node.js versions have Makefiles with unquoted glob patterns like
`rm -f *.o` that fail in zsh's strict glob mode. By passing
SHELL=/bin/sh to make, we ensure POSIX-compliant shell behavior
regardless of what shell nvm is running in.
2026-01-26 15:07:01 -08:00
167 changed files with 189 additions and 11 deletions

View File

@@ -82,7 +82,7 @@ jobs:
unset NVM_CD_FLAGS NVM_BIN NVM_INC unset NVM_CD_FLAGS NVM_BIN NVM_INC
export NVM_DIR="${{ github.workspace }}" export NVM_DIR="${{ github.workspace }}"
export PATH="$(echo "$PATH" | tr ':' '\n' | grep -v '\.nvm' | grep -v 'toolcache' | tr '\n' ':')" export PATH="$(echo "$PATH" | tr ':' '\n' | grep -v '\.nvm' | grep -v 'toolcache' | tr '\n' ':')"
make TERM=xterm-256color TEST_SUITE="fast" SHELL="${{ matrix.shell }}" URCHIN="$URCHIN_PATH" test-${{ matrix.shell }} make TEST_SUITE="fast" SHELL="${{ matrix.shell }}" URCHIN="$URCHIN_PATH" test-${{ matrix.shell }}
- name: Restore system node - name: Restore system node
if: always() if: always()
run: | run: |

View File

@@ -76,7 +76,7 @@ jobs:
unset NVM_CD_FLAGS NVM_BIN NVM_INC unset NVM_CD_FLAGS NVM_BIN NVM_INC
export NVM_DIR="${{ github.workspace }}" export NVM_DIR="${{ github.workspace }}"
export PATH="$(echo "$PATH" | tr ':' '\n' | grep -v '\.nvm' | grep -v 'toolcache' | tr '\n' ':')" export PATH="$(echo "$PATH" | tr ':' '\n' | grep -v '\.nvm' | grep -v 'toolcache' | tr '\n' ':')"
make TERM=xterm-256color TEST_SUITE="installation_iojs" SHELL="${{ matrix.shell }}" URCHIN="$URCHIN_PATH" test-${{ matrix.shell }} make TEST_SUITE="installation_iojs" SHELL="${{ matrix.shell }}" URCHIN="$URCHIN_PATH" test-${{ matrix.shell }}
- name: Restore system node - name: Restore system node
if: always() if: always()
run: | run: |

View File

@@ -68,7 +68,7 @@ jobs:
- run: npm ls urchin - run: npm ls urchin
- run: npx which urchin - run: npx which urchin
- run: env - run: env
- run: make TERM=xterm-256color TEST_SUITE="${{ matrix.suite }}" SHELL="${{ matrix.shell }}" URCHIN="$(npx which urchin)" test-${{ matrix.shell }} - run: make TEST_SUITE="${{ matrix.suite }}" SHELL="${{ matrix.shell }}" URCHIN="$(npx which urchin)" test-${{ matrix.shell }}
nvm: nvm:
permissions: permissions:

View File

@@ -6,7 +6,7 @@
</a> </a>
# Node Version Manager [![Build Status](https://app.travis-ci.com/nvm-sh/nvm.svg?branch=master)][3] [![nvm version](https://img.shields.io/badge/version-v0.40.3-yellow.svg)][4] [![CII Best Practices](https://bestpractices.dev/projects/684/badge)](https://bestpractices.dev/projects/684) # Node Version Manager [![Tests](https://github.com/nvm-sh/nvm/actions/workflows/tests-fast.yml/badge.svg?branch=master)][3] [![nvm version](https://img.shields.io/badge/version-v0.40.3-yellow.svg)][4] [![CII Best Practices](https://bestpractices.dev/projects/684/badge)](https://bestpractices.dev/projects/684)
<!-- To update this table of contents, ensure you have run `npm install` then `npm run doctoc` --> <!-- To update this table of contents, ensure you have run `npm install` then `npm run doctoc` -->
<!-- START doctoc generated TOC please keep comment here to allow auto update --> <!-- START doctoc generated TOC please keep comment here to allow auto update -->
@@ -1038,7 +1038,7 @@ To change the user directory and/or account name follow the instructions [here](
[1]: https://github.com/nvm-sh/nvm.git [1]: https://github.com/nvm-sh/nvm.git
[2]: https://github.com/nvm-sh/nvm/blob/v0.40.3/install.sh [2]: https://github.com/nvm-sh/nvm/blob/v0.40.3/install.sh
[3]: https://app.travis-ci.com/nvm-sh/nvm [3]: https://github.com/nvm-sh/nvm/actions/workflows/tests-fast.yml
[4]: https://github.com/nvm-sh/nvm/releases/tag/v0.40.3 [4]: https://github.com/nvm-sh/nvm/releases/tag/v0.40.3
[Urchin]: https://git.sdf.org/tlevine/urchin [Urchin]: https://git.sdf.org/tlevine/urchin
[Fish]: https://fishshell.com [Fish]: https://fishshell.com

11
nvm.sh
View File

@@ -978,13 +978,18 @@ nvm_strip_path() {
nvm_err '${NVM_DIR} not set!' nvm_err '${NVM_DIR} not set!'
return 1 return 1
fi fi
command printf %s "${1-}" | command awk -v NVM_DIR="${NVM_DIR}" -v RS=: ' local RESULT
RESULT="$(command printf %s "${1-}" | command awk -v NVM_DIR="${NVM_DIR}" -v RS=: '
index($0, NVM_DIR) == 1 { index($0, NVM_DIR) == 1 {
path = substr($0, length(NVM_DIR) + 1) path = substr($0, length(NVM_DIR) + 1)
if (path ~ "^(/versions/[^/]*)?/[^/]*'"${2-}"'.*$") { next } if (path ~ "^(/versions/[^/]*)?/[^/]*'"${2-}"'.*$") { next }
} }
# The final RT will contain a colon if the input has a trailing colon, or a null string otherwise { printf "%s%s", sep, $0; sep=RS }')"
{ printf "%s%s", sep, $0; sep=RS } END { printf "%s", RT }' # mawk does not support RT, so preserve trailing colon manually
case "${1-}" in
*:) command printf '%s:' "${RESULT}" ;;
*) command printf '%s' "${RESULT}" ;;
esac
} }
nvm_change_path() { nvm_change_path() {

View File

@@ -4,6 +4,7 @@ die() { echo "$@" ; exit 1; }
export NVM_DIR="$(cd ../../.. && pwd)" export NVM_DIR="$(cd ../../.. && pwd)"
: nvm.sh
\. "${NVM_DIR}/nvm.sh" \. "${NVM_DIR}/nvm.sh"
\. ../../common.sh \. ../../common.sh

View File

@@ -1,5 +1,6 @@
#!/bin/sh #!/bin/sh
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
die () { echo "$@" ; exit 1; } die () { echo "$@" ; exit 1; }

View File

@@ -1,5 +1,6 @@
#!/bin/sh #!/bin/sh
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
die () { echo "$@" ; exit 1; } die () { echo "$@" ; exit 1; }

View File

@@ -1,5 +1,6 @@
#!/bin/sh #!/bin/sh
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
die () { echo "$@" ; exit 1; } die () { echo "$@" ; exit 1; }

View File

@@ -1,5 +1,6 @@
#!/bin/sh #!/bin/sh
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
die () { echo "$@" ; exit 1; } die () { echo "$@" ; exit 1; }

View File

@@ -1,5 +1,6 @@
#!/bin/sh #!/bin/sh
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
die () { echo "$@" ; exit 1; } die () { echo "$@" ; exit 1; }

View File

@@ -1,5 +1,6 @@
#!/bin/sh #!/bin/sh
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
\. ../../common.sh \. ../../common.sh

View File

@@ -1,4 +1,5 @@
#!/bin/sh #!/bin/sh
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
[ $(nvm alias test-stable-1 | wc -l) = '2' ] [ $(nvm alias test-stable-1 | wc -l) = '2' ]

View File

@@ -1,5 +1,6 @@
#!/bin/sh #!/bin/sh
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
\. ../../common.sh \. ../../common.sh

View File

@@ -1,5 +1,6 @@
#!/bin/sh #!/bin/sh
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
\. ../../common.sh \. ../../common.sh

View File

@@ -1,5 +1,6 @@
#!/bin/sh #!/bin/sh
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
\. ../../common.sh \. ../../common.sh

View File

@@ -3,6 +3,7 @@
die () { echo "$@" ; exit 1; } die () { echo "$@" ; exit 1; }
: nvm.sh
\. ../../../../nvm.sh \. ../../../../nvm.sh
ALIAS="$(nvm_resolve_alias loopback | strip_colors)" ALIAS="$(nvm_resolve_alias loopback | strip_colors)"

View File

@@ -3,6 +3,7 @@
die () { echo "$@" ; exit 1; } die () { echo "$@" ; exit 1; }
: nvm.sh
\. ../../../../nvm.sh \. ../../../../nvm.sh
ALIAS="$(nvm_resolve_local_alias loopback | strip_colors)" ALIAS="$(nvm_resolve_local_alias loopback | strip_colors)"

View File

@@ -2,6 +2,7 @@
set -ex set -ex
: nvm.sh
\. ../../../../nvm.sh \. ../../../../nvm.sh
\. ../../../common.sh \. ../../../common.sh

View File

@@ -1,5 +1,6 @@
#!/bin/sh #!/bin/sh
: nvm.sh
\. ../../../../nvm.sh \. ../../../../nvm.sh
LTS_ALIAS_PATH="$(nvm_alias_path)/lts" LTS_ALIAS_PATH="$(nvm_alias_path)/lts"

View File

@@ -1,5 +1,6 @@
#!/bin/sh #!/bin/sh
: nvm.sh
\. ../../../../nvm.sh \. ../../../../nvm.sh
LTS_ALIAS_PATH="$(nvm_alias_path)/lts" LTS_ALIAS_PATH="$(nvm_alias_path)/lts"

View File

@@ -4,6 +4,7 @@
die () { echo "$@" ; exit 1; } die () { echo "$@" ; exit 1; }
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
nvm alias default 0.1 >/dev/null || die "'nvm alias default 0.1' failed" nvm alias default 0.1 >/dev/null || die "'nvm alias default 0.1' failed"

View File

@@ -1,5 +1,6 @@
#!/bin/sh #!/bin/sh
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
die () { echo "$@" ; exit 1; } die () { echo "$@" ; exit 1; }

View File

@@ -1,5 +1,6 @@
#!/bin/sh #!/bin/sh
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
die () { die () {

View File

@@ -1,5 +1,6 @@
#!/bin/sh #!/bin/sh
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
die () { die () {

View File

@@ -1,5 +1,6 @@
#!/bin/sh #!/bin/sh
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
die () { die () {

View File

@@ -1,5 +1,6 @@
#!/bin/sh #!/bin/sh
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
die () { die () {

View File

@@ -4,6 +4,7 @@ die () { echo "$@" ; exit 1; }
export NVM_DIR="$(cd ../../.. && pwd)" export NVM_DIR="$(cd ../../.. && pwd)"
: nvm.sh
\. "${NVM_DIR}/nvm.sh" \. "${NVM_DIR}/nvm.sh"
EXIT_CODE=$(nvm_resolve_alias ; echo $?) EXIT_CODE=$(nvm_resolve_alias ; echo $?)

View File

@@ -2,6 +2,7 @@
die () { echo "$@" ; exit 1; } die () { echo "$@" ; exit 1; }
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
EXIT_CODE=$(nvm_resolve_local_alias ; echo $?) EXIT_CODE=$(nvm_resolve_local_alias ; echo $?)

View File

@@ -2,6 +2,7 @@
export NVM_DIR="$(cd ../../.. && pwd)" export NVM_DIR="$(cd ../../.. && pwd)"
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
\. ../../common.sh \. ../../common.sh

View File

@@ -1,5 +1,6 @@
#!/bin/sh #!/bin/sh
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
\. ../../common.sh \. ../../common.sh

View File

@@ -1,5 +1,6 @@
#!/bin/sh #!/bin/sh
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
nvm which nonexistent_version nvm which nonexistent_version

View File

@@ -1,5 +1,6 @@
#!/bin/sh #!/bin/sh
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
\. ../../common.sh \. ../../common.sh

View File

@@ -1,5 +1,6 @@
#!/bin/sh #!/bin/sh
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
\. ../../common.sh \. ../../common.sh

View File

@@ -1,5 +1,6 @@
#!/bin/sh #!/bin/sh
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
\. ../../common.sh \. ../../common.sh

View File

@@ -1,5 +1,6 @@
#!/bin/sh #!/bin/sh
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
\. ../../common.sh \. ../../common.sh

View File

@@ -1,5 +1,6 @@
#!/bin/sh #!/bin/sh
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
nvm ls nonexistent_version nvm ls nonexistent_version

View File

@@ -1,5 +1,6 @@
#!/bin/sh #!/bin/sh
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
nvm ls io nvm ls io

View File

@@ -1,5 +1,6 @@
#!/bin/sh #!/bin/sh
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
nvm ls node_ nvm ls node_

View File

@@ -1,5 +1,6 @@
#!/bin/sh #!/bin/sh
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
\. ../../common.sh \. ../../common.sh

View File

@@ -2,6 +2,7 @@
die () { echo "$@" ; exit 1; } die () { echo "$@" ; exit 1; }
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
\. ../../common.sh \. ../../common.sh

View File

@@ -1,5 +1,6 @@
#!/bin/sh #!/bin/sh
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
\. ../../common.sh \. ../../common.sh

View File

@@ -1,5 +1,6 @@
#!/bin/sh #!/bin/sh
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
\. ../../common.sh \. ../../common.sh

View File

@@ -1,5 +1,6 @@
#!/bin/sh #!/bin/sh
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
\. ../../common.sh \. ../../common.sh

View File

@@ -1,5 +1,6 @@
#!/bin/sh #!/bin/sh
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
\. ../../common.sh \. ../../common.sh

View File

@@ -2,6 +2,7 @@
die () { echo "$@" ; exit 1; } die () { echo "$@" ; exit 1; }
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
\. ../../common.sh \. ../../common.sh

View File

@@ -2,6 +2,7 @@
die () { echo "$@" ; exit 1; } die () { echo "$@" ; exit 1; }
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
\. ../../common.sh \. ../../common.sh

View File

@@ -2,6 +2,7 @@
export NVM_DIR="$(cd ../../.. && pwd)" export NVM_DIR="$(cd ../../.. && pwd)"
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
\. ../../common.sh \. ../../common.sh

View File

@@ -1,5 +1,6 @@
#!/bin/sh #!/bin/sh
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
\. ../../common.sh \. ../../common.sh

View File

@@ -2,6 +2,7 @@
die () { echo "$@" ; exit 1; } die () { echo "$@" ; exit 1; }
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
\. ../../common.sh \. ../../common.sh

View File

@@ -1,5 +1,6 @@
#!/bin/sh #!/bin/sh
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
\. ../../common.sh \. ../../common.sh

View File

@@ -4,6 +4,7 @@ set -ex
export NVM_DIR="$(cd ../.. && pwd)" export NVM_DIR="$(cd ../.. && pwd)"
: nvm.sh
\. ../../nvm.sh \. ../../nvm.sh
nvm alias test v0.1.2 nvm alias test v0.1.2

View File

@@ -6,6 +6,7 @@ die () { echo "$@" ; exit 1; }
export NVM_DIR="$(cd ../.. && pwd)" export NVM_DIR="$(cd ../.. && pwd)"
: nvm.sh
\. ../../nvm.sh \. ../../nvm.sh
nvm deactivate 2>&1 nvm deactivate 2>&1

View File

@@ -6,6 +6,7 @@ die () { echo "$@" ; exit 1; }
export NVM_DIR="$(cd ../.. && pwd)" export NVM_DIR="$(cd ../.. && pwd)"
: nvm.sh
\. ../../nvm.sh \. ../../nvm.sh
\. ../common.sh \. ../common.sh

View File

@@ -9,6 +9,7 @@ cleanup () {
export NVM_DIR="$(cd ../.. && pwd)" export NVM_DIR="$(cd ../.. && pwd)"
: nvm.sh
\. ../../nvm.sh \. ../../nvm.sh
\. ../common.sh \. ../common.sh

View File

@@ -6,6 +6,7 @@ die () { echo "$@" ; exit 1; }
export NVM_DIR="$(cd ../.. && pwd)" export NVM_DIR="$(cd ../.. && pwd)"
: nvm.sh
\. ../../nvm.sh \. ../../nvm.sh
set +ex # needed for stderr set +ex # needed for stderr

View File

@@ -6,6 +6,7 @@ ALIAS_PATH="../../alias"
echo v0.1.2 > "${ALIAS_PATH}/test" echo v0.1.2 > "${ALIAS_PATH}/test"
: nvm.sh
\. ../../nvm.sh \. ../../nvm.sh
nvm unalias test nvm unalias test

View File

@@ -2,6 +2,7 @@
set -ex set -ex
: nvm.sh
\. ../../nvm.sh \. ../../nvm.sh
\. ../common.sh \. ../common.sh

View File

@@ -2,6 +2,7 @@
set -ex set -ex
: nvm.sh
\. ../../nvm.sh \. ../../nvm.sh
\. ../common.sh \. ../common.sh

View File

@@ -12,6 +12,7 @@ typeset -f | awk '/ \(\) $/ && !/^main / {print $1}' > "${BEFORE}"
env | grep -v PATH= | grep -v IFS= | grep -v NVM_ | grep -v TRAVIS_ | sort >> "${BEFORE}" env | grep -v PATH= | grep -v IFS= | grep -v NVM_ | grep -v TRAVIS_ | sort >> "${BEFORE}"
set +e # TODO: fix set +e # TODO: fix
: nvm.sh
\. ../../nvm.sh \. ../../nvm.sh
set -e set -e

View File

@@ -8,6 +8,7 @@ cleanup() {
rm -rf "$(nvm_alias_path)/foo" rm -rf "$(nvm_alias_path)/foo"
} }
: nvm.sh
\. ../../nvm.sh \. ../../nvm.sh
nvm_make_alias foo foo nvm_make_alias foo foo

View File

@@ -13,6 +13,7 @@ cleanup() {
rm -rf "$(nvm_version_path "iojs-${VERSION}")" rm -rf "$(nvm_version_path "iojs-${VERSION}")"
} }
: nvm.sh
\. ../../nvm.sh \. ../../nvm.sh
nvm deactivate || die "unable to deactivate; current: >$(nvm current)<" nvm deactivate || die "unable to deactivate; current: >$(nvm current)<"

View File

@@ -7,6 +7,7 @@ cleanup() {
} }
die() { echo "$@" ; cleanup ; exit 1; } die() { echo "$@" ; cleanup ; exit 1; }
: nvm.sh
\. ../../nvm.sh \. ../../nvm.sh
nvm_has_system_node() { return 0; } nvm_has_system_node() { return 0; }

View File

@@ -3,6 +3,7 @@
set -ex set -ex
export NVM_SYMLINK_CURRENT=true export NVM_SYMLINK_CURRENT=true
: nvm.sh
\. ../../nvm.sh \. ../../nvm.sh
\. ../common.sh \. ../common.sh

View File

@@ -2,6 +2,7 @@
set -ex set -ex
: nvm.sh
\. ../../nvm.sh \. ../../nvm.sh
\. ../common.sh \. ../common.sh

View File

@@ -9,6 +9,7 @@ cleanup() {
rm .nvmrc rm .nvmrc
} }
: nvm.sh
\. ../../nvm.sh \. ../../nvm.sh
# normal .nvmrc # normal .nvmrc

View File

@@ -1,9 +1,12 @@
#!/bin/bash #!/bin/bash
set -x set -x
: nvm.sh
\. ../../nvm.sh \. ../../nvm.sh
die () { echo "$@" ; rm .nvmrc ; exit 1; } cleanup() { rm -f .nvmrc; }
die () { echo "$@" ; cleanup ; exit 1; }
NVM_TEST_VERSION=v0.42 NVM_TEST_VERSION=v0.42
@@ -18,3 +21,5 @@ No NODE_VERSION provided; no .nvmrc file found";
# Skip install, we want to test the error message # Skip install, we want to test the error message
[ "${EXPECTED}" = "${OUTPUT}" ] || die "expected >${EXPECTED}<, got >${OUTPUT}<" [ "${EXPECTED}" = "${OUTPUT}" ] || die "expected >${EXPECTED}<, got >${OUTPUT}<"
cleanup

View File

@@ -11,6 +11,7 @@ cleanup() {
echo "Tested nvm_echo_with_colors" echo "Tested nvm_echo_with_colors"
} }
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
OUTPUT="$(nvm_echo_with_colors "\033[0;36mCyan-colored text")" OUTPUT="$(nvm_echo_with_colors "\033[0;36mCyan-colored text")"

View File

@@ -8,6 +8,7 @@ cleanup() {
echo "Tested nvm_err_with_colors" echo "Tested nvm_err_with_colors"
} }
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
set +ex set +ex

View File

@@ -1,5 +1,6 @@
#!/bin/sh #!/bin/sh
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
die () { die () {

View File

@@ -1,5 +1,6 @@
#!/bin/sh #!/bin/sh
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
#set -e #nvm use system returns 127 and No system set message #set -e #nvm use system returns 127 and No system set message

View File

@@ -2,6 +2,7 @@
set -ex set -ex
: nvm.sh
\. ../../nvm.sh \. ../../nvm.sh
nvm nvm

View File

@@ -3,5 +3,6 @@
set -ex set -ex
set -- yes set -- yes
: nvm.sh
\. ../../nvm.sh \. ../../nvm.sh
[ "$1" = yes ] [ "$1" = yes ]

View File

@@ -1,4 +1,5 @@
#!/bin/sh #!/bin/sh
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
\. ../../common.sh \. ../../common.sh

View File

@@ -1,4 +1,5 @@
#!/bin/sh #!/bin/sh
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
\. ../../common.sh \. ../../common.sh

View File

@@ -1,4 +1,5 @@
#!/bin/sh #!/bin/sh
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
\. ../../common.sh \. ../../common.sh

View File

@@ -1,4 +1,5 @@
#!/bin/sh #!/bin/sh
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
\. ../../common.sh \. ../../common.sh

View File

@@ -2,6 +2,7 @@
die () { echo "$@" ; exit 1; } die () { echo "$@" ; exit 1; }
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
nvm_install_source() { nvm_install_source() {

View File

@@ -2,6 +2,7 @@
die () { echo "$@" ; exit 1; } die () { echo "$@" ; exit 1; }
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
REMOTE="${PWD}/mocks/nvm_ls_remote.txt" REMOTE="${PWD}/mocks/nvm_ls_remote.txt"

View File

@@ -12,6 +12,7 @@ cleanup() {
mv "${NVM_DIR}/alias/lts-backup" "${NVM_DIR}/alias/lts" mv "${NVM_DIR}/alias/lts-backup" "${NVM_DIR}/alias/lts"
} }
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
if [ -n "${NVM_COLORS-}" ]; then if [ -n "${NVM_COLORS-}" ]; then
export TEMP_NVM_COLORS=NVM_COLORS export TEMP_NVM_COLORS=NVM_COLORS

View File

@@ -13,6 +13,7 @@ cleanup() {
unset TEMP_NVM_COLORS unset TEMP_NVM_COLORS
} }
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
# NVM_COLORS is not set # NVM_COLORS is not set
if [ -n ${NVM_COLORS} ]; then if [ -n ${NVM_COLORS} ]; then

View File

@@ -8,6 +8,7 @@ cleanup() {
unset -f nvm_remote_version unset -f nvm_remote_version
} }
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
\. ../../common.sh \. ../../common.sh

View File

@@ -2,6 +2,7 @@
die () { echo "$@" ; exit 1; } die () { echo "$@" ; exit 1; }
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
[ "_$(nvm_add_iojs_prefix 1)" = "_iojs-v1" ] || die '"nvm_add_iojs_prefix 1" did not return "iojs-v1"' [ "_$(nvm_add_iojs_prefix 1)" = "_iojs-v1" ] || die '"nvm_add_iojs_prefix 1" did not return "iojs-v1"'

View File

@@ -6,6 +6,7 @@ cleanup () {
rm -rf ../../../alias/test rm -rf ../../../alias/test
} }
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
OUTPUT="$(nvm_alias 2>&1)" OUTPUT="$(nvm_alias 2>&1)"

View File

@@ -9,6 +9,7 @@ cleanup() {
mv "${NVM_DIR}/alias/lts-backup" "${NVM_DIR}/alias/lts" mv "${NVM_DIR}/alias/lts-backup" "${NVM_DIR}/alias/lts"
} }
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
MOCKS_DIR="${PWD}/mocks" MOCKS_DIR="${PWD}/mocks"

View File

@@ -8,6 +8,7 @@ cleanup () {
rm -rf ../../../alias/test-comment-first rm -rf ../../../alias/test-comment-first
} }
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
# Test: alias file with comment on separate line # Test: alias file with comment on separate line

View File

@@ -2,6 +2,7 @@
die () { echo "$@" ; exit 1; } die () { echo "$@" ; exit 1; }
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
[ "_$(nvm_alias_path)" = "_$NVM_DIR/alias" ] || die "nvm_alias_path did not return correct location" [ "_$(nvm_alias_path)" = "_$NVM_DIR/alias" ] || die "nvm_alias_path did not return correct location"

View File

@@ -2,6 +2,7 @@
die () { echo "$@" ; exit 1; } die () { echo "$@" ; exit 1; }
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
TEST_PATH=/usr/bin:/usr/local/bin TEST_PATH=/usr/bin:/usr/local/bin

View File

@@ -2,6 +2,7 @@
die () { echo "$@" ; exit 1; } die () { echo "$@" ; exit 1; }
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
TERM=dumb nvm clear-cache --help | grep 'Usage:' || die 'did not print help menu' TERM=dumb nvm clear-cache --help | grep 'Usage:' || die 'did not print help menu'

View File

@@ -8,6 +8,7 @@ cleanup() {
die() { echo "$@" ; cleanup ; exit 1; } die() { echo "$@" ; cleanup ; exit 1; }
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh

View File

@@ -5,6 +5,7 @@ cleanup () {
} }
die () { echo "$@" ; cleanup ; exit 1; } die () { echo "$@" ; cleanup ; exit 1; }
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
set -ex set -ex

View File

@@ -4,6 +4,7 @@ set -ex
die () { echo "$@" ; exit 1; } die () { echo "$@" ; exit 1; }
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
set +x set +x

View File

@@ -6,6 +6,7 @@ cleanup() {
die() { cleanup; echo "$@" ; exit 1; } die() { cleanup; echo "$@" ; exit 1; }
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
curl() { curl() {

View File

@@ -3,6 +3,7 @@
TEST_PWD=$(pwd) TEST_PWD=$(pwd)
TEST_DIR="$TEST_PWD/nvm_die_on_prefix_tmp" TEST_DIR="$TEST_PWD/nvm_die_on_prefix_tmp"
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
TEST_VERSION_DIR="${TEST_DIR}/version" TEST_VERSION_DIR="${TEST_DIR}/version"
@@ -11,7 +12,7 @@ cleanup () {
rm -rf "$TEST_DIR" rm -rf "$TEST_DIR"
alias nvm_has='\nvm_has' alias nvm_has='\nvm_has'
alias npm='\npm' alias npm='\npm'
unset -f nvm_has npm unset -f nvm_has npm node
} }
die () { die () {
@@ -60,6 +61,12 @@ npm() {
fi fi
} }
node() {
if [ "_$1" = "_-v" ]; then
echo "v0.0.0"
fi
}
OUTPUT="$(nvm_die_on_prefix 0 foo "$(nvm_version_dir new)" 2>&1)" OUTPUT="$(nvm_die_on_prefix 0 foo "$(nvm_version_dir new)" 2>&1)"
[ -z "$OUTPUT" ] || die "'nvm_die_on_prefix' was not a noop when directory is equivalent; got '$OUTPUT'" [ -z "$OUTPUT" ] || die "'nvm_die_on_prefix' was not a noop when directory is equivalent; got '$OUTPUT'"

View File

@@ -6,6 +6,7 @@ cleanup () {
} }
die () { echo "$@" ; cleanup ; exit 1; } die () { echo "$@" ; cleanup ; exit 1; }
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
set -ex set -ex

View File

@@ -5,6 +5,7 @@ cleanup () {
} }
die () { echo "$@" ; cleanup ; exit 1; } die () { echo "$@" ; cleanup ; exit 1; }
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
# bad flavor # bad flavor

View File

@@ -4,6 +4,7 @@
die () { echo "$@" ; exit 1; } die () { echo "$@" ; exit 1; }
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
EXPECTED_OUTPUT="nvm_ensure_default_set: a version is required" EXPECTED_OUTPUT="nvm_ensure_default_set: a version is required"

View File

@@ -6,6 +6,7 @@ cleanup () {
unset -f nvm_has_system_node nvm_has_system_iojs unset -f nvm_has_system_node nvm_has_system_iojs
} }
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
\. ../../common.sh \. ../../common.sh

View File

@@ -2,6 +2,7 @@
die () { echo "$@" ; exit 1; } die () { echo "$@" ; exit 1; }
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
[ "_$(nvm_ensure_version_prefix 1)" = "_v1" ] || die '"nvm_ensure_version_prefix 1" did not return "v1"' [ "_$(nvm_ensure_version_prefix 1)" = "_v1" ] || die '"nvm_ensure_version_prefix 1" did not return "v1"'

View File

@@ -2,6 +2,7 @@
die () { echo "$@" ; exit 1; } die () { echo "$@" ; exit 1; }
: nvm.sh
\. ../../../nvm.sh \. ../../../nvm.sh
[ "$(nvm_extract_tarball 2>&1)" = "nvm_extract_tarball requires exactly 4 arguments" ] || die 'incorrect error message with no args' [ "$(nvm_extract_tarball 2>&1)" = "nvm_extract_tarball requires exactly 4 arguments" ] || die 'incorrect error message with no args'

Some files were not shown because too many files have changed in this diff Show More