mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-08-17 11:03:44 +00:00
Compare commits
4 Commits
cd7319b833
...
940e1027a7
Author | SHA1 | Date | |
---|---|---|---|
![]() |
940e1027a7 | ||
![]() |
cae2eb71a2 | ||
![]() |
9f520c97db | ||
![]() |
e5521cfd3c |
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@ -19,6 +19,8 @@ jobs:
|
|||||||
raw.githubusercontent.com:443
|
raw.githubusercontent.com:443
|
||||||
registry.npmjs.org:443
|
registry.npmjs.org:443
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-tags: true
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: "14"
|
node-version: "14"
|
||||||
|
@ -163,7 +163,8 @@ install_nvm_from_git() {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
# Cloning repo
|
# Cloning repo
|
||||||
command git clone "$(nvm_source)" --depth=1 "${INSTALL_DIR}" || {
|
command git clone "$(nvm_source)" --depth=1 -o origin "${INSTALL_DIR}" 2> /dev/null \
|
||||||
|
|| command git clone "$(nvm_source)" --depth=1 "${INSTALL_DIR}" || {
|
||||||
nvm_echo >&2 'Failed to clone nvm repo. Please report this!'
|
nvm_echo >&2 'Failed to clone nvm repo. Please report this!'
|
||||||
exit 2
|
exit 2
|
||||||
}
|
}
|
||||||
|
28
test/slow/nvm run/Running 'nvm run --silent' should work
Executable file
28
test/slow/nvm run/Running 'nvm run --silent' should work
Executable file
@ -0,0 +1,28 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -ex
|
||||||
|
|
||||||
|
die () { echo "$@" ; exit 1; }
|
||||||
|
|
||||||
|
. ../../../nvm.sh
|
||||||
|
|
||||||
|
echo "0.10.7" > .nvmrc
|
||||||
|
|
||||||
|
# Check nvm run without --silent
|
||||||
|
OUTPUT="$(nvm run --version)"
|
||||||
|
EXPECTED_OUTPUT="Found '${PWD}/.nvmrc' with version <0.10.7>
|
||||||
|
Running node v0.10.7 (npm v1.2.21)
|
||||||
|
v0.10.7"
|
||||||
|
[ ">${OUTPUT}<" = ">${EXPECTED_OUTPUT}<" ] \
|
||||||
|
|| die "\`nvm run\` failed to run; did not match with the .nvmrc version; got >${OUTPUT}<"
|
||||||
|
|
||||||
|
OUTPUT="$(nvm run --silent --version)"
|
||||||
|
EXPECTED_OUTPUT="v0.10.7"
|
||||||
|
[ "${OUTPUT}" = "${EXPECTED_OUTPUT}" ] \
|
||||||
|
|| die "\`nvm run --silent\` failed to run silently; expected no output, got >${OUTPUT}<"
|
||||||
|
|
||||||
|
# Output shouldn't be silent if --silent flag is not at the third argument position
|
||||||
|
OUTPUT="$(nvm run --version --silent)"
|
||||||
|
EXPECTED_OUTPUT=""
|
||||||
|
[ "${OUTPUT}" != "${EXPECTED_OUTPUT}" ] \
|
||||||
|
|| die "\`nvm run --version --silent\` should not be silent; expected >${OUTPUT}<, got no output"
|
Loading…
x
Reference in New Issue
Block a user