mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-08-16 18:43:43 +00:00
Compare commits
5 Commits
faab325888
...
ca800fb5c1
Author | SHA1 | Date | |
---|---|---|---|
![]() |
ca800fb5c1 | ||
![]() |
74eb396099 | ||
![]() |
996ae54fde | ||
![]() |
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"
|
||||||
|
@ -106,7 +106,7 @@ nvm_node_version() {
|
|||||||
|
|
||||||
nvm_download() {
|
nvm_download() {
|
||||||
if nvm_has "curl"; then
|
if nvm_has "curl"; then
|
||||||
curl --fail --compressed -q "$@"
|
command curl --fail --compressed -q "$@"
|
||||||
elif nvm_has "wget"; then
|
elif nvm_has "wget"; then
|
||||||
# Emulate curl with wget
|
# Emulate curl with wget
|
||||||
ARGS=$(nvm_echo "$@" | command sed -e 's/--progress-bar /--progress=bar /' \
|
ARGS=$(nvm_echo "$@" | command sed -e 's/--progress-bar /--progress=bar /' \
|
||||||
|
4
nvm.sh
4
nvm.sh
@ -101,7 +101,7 @@ nvm_get_latest() {
|
|||||||
if nvm_curl_use_compression; then
|
if nvm_curl_use_compression; then
|
||||||
CURL_COMPRESSED_FLAG="--compressed"
|
CURL_COMPRESSED_FLAG="--compressed"
|
||||||
fi
|
fi
|
||||||
NVM_LATEST_URL="$(curl ${CURL_COMPRESSED_FLAG:-} -q -w "%{url_effective}\\n" -L -s -S https://latest.nvm.sh -o /dev/null)"
|
NVM_LATEST_URL="$(command curl ${CURL_COMPRESSED_FLAG:-} -q -w "%{url_effective}\\n" -L -s -S https://latest.nvm.sh -o /dev/null)"
|
||||||
elif nvm_has "wget"; then
|
elif nvm_has "wget"; then
|
||||||
NVM_LATEST_URL="$(wget -q https://latest.nvm.sh --server-response -O /dev/null 2>&1 | command awk '/^ Location: /{DEST=$2} END{ print DEST }')"
|
NVM_LATEST_URL="$(wget -q https://latest.nvm.sh --server-response -O /dev/null 2>&1 | command awk '/^ Location: /{DEST=$2} END{ print DEST }')"
|
||||||
else
|
else
|
||||||
@ -133,7 +133,7 @@ nvm_download() {
|
|||||||
for arg in "$@"; do
|
for arg in "$@"; do
|
||||||
NVM_DOWNLOAD_ARGS="${NVM_DOWNLOAD_ARGS} \"$arg\""
|
NVM_DOWNLOAD_ARGS="${NVM_DOWNLOAD_ARGS} \"$arg\""
|
||||||
done
|
done
|
||||||
eval "curl -q --fail ${CURL_COMPRESSED_FLAG:-} ${CURL_HEADER_FLAG:-} ${NVM_DOWNLOAD_ARGS}"
|
eval "command curl -q --fail ${CURL_COMPRESSED_FLAG:-} ${CURL_HEADER_FLAG:-} ${NVM_DOWNLOAD_ARGS}"
|
||||||
elif nvm_has "wget"; then
|
elif nvm_has "wget"; then
|
||||||
# Emulate curl with wget
|
# Emulate curl with wget
|
||||||
ARGS=$(nvm_echo "$@" | command sed -e 's/--progress-bar /--progress=bar /' \
|
ARGS=$(nvm_echo "$@" | command sed -e 's/--progress-bar /--progress=bar /' \
|
||||||
|
@ -45,7 +45,7 @@
|
|||||||
"dockerfile_lint": "^0.3.4",
|
"dockerfile_lint": "^0.3.4",
|
||||||
"doctoc": "^2.2.1",
|
"doctoc": "^2.2.1",
|
||||||
"eclint": "^2.8.1",
|
"eclint": "^2.8.1",
|
||||||
"markdown-link-check": "^3.12.2",
|
"markdown-link-check": "^3.13.6",
|
||||||
"replace": "^1.2.2",
|
"replace": "^1.2.2",
|
||||||
"semver": "^7.6.3",
|
"semver": "^7.6.3",
|
||||||
"urchin": "^0.0.5"
|
"urchin": "^0.0.5"
|
||||||
|
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