mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-08-16 18:43:43 +00:00
Compare commits
3 Commits
7ccba0e55e
...
0c34bc5079
Author | SHA1 | Date | |
---|---|---|---|
![]() |
0c34bc5079 | ||
![]() |
762f9ef9d1 | ||
![]() |
56a71c78f5 |
@ -32,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 install 2.7.18
|
- pyenv local 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:
|
||||||
|
30
nvm.sh
30
nvm.sh
@ -121,20 +121,21 @@ nvm_download() {
|
|||||||
if nvm_curl_use_compression; then
|
if nvm_curl_use_compression; then
|
||||||
CURL_COMPRESSED_FLAG="--compressed"
|
CURL_COMPRESSED_FLAG="--compressed"
|
||||||
fi
|
fi
|
||||||
curl --fail ${CURL_COMPRESSED_FLAG:-} -q "$@"
|
# shellcheck disable=SC1083
|
||||||
|
curl --fail ${CURL_COMPRESSED_FLAG:-} -q -w %{http_code} "$@"
|
||||||
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 /' \
|
||||||
-e 's/--compressed //' \
|
-e 's/--compressed //' \
|
||||||
-e 's/--fail //' \
|
-e 's/--fail //' \
|
||||||
-e 's/-L //' \
|
-e 's/-L //' \
|
||||||
-e 's/-I /--server-response /' \
|
-e 's/-I /--server-response /' \
|
||||||
-e 's/-s /-q /' \
|
-e 's/-s /-q /' \
|
||||||
-e 's/-sS /-nv /' \
|
-e 's/-sS /-nv /' \
|
||||||
-e 's/-o /-O /' \
|
-e 's/-o /-O /' \
|
||||||
-e 's/-C - /-c /')
|
-e 's/-C - /-c /')
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
eval wget $ARGS
|
eval wget -S $ARGS 2>&1 | grep '^ HTTP/' | awk '{print $2}'
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2417,12 +2418,17 @@ nvm_download_artifact() {
|
|||||||
nvm_err "Removing the broken local cache..."
|
nvm_err "Removing the broken local cache..."
|
||||||
command rm -rf "${TARBALL}"
|
command rm -rf "${TARBALL}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
nvm_err "Downloading ${TARBALL_URL}..."
|
nvm_err "Downloading ${TARBALL_URL}..."
|
||||||
nvm_download -L -C - "${PROGRESS_BAR}" "${TARBALL_URL}" -o "${TARBALL}" || (
|
download_result=$(nvm_download -L -C - "${PROGRESS_BAR}" "${TARBALL_URL}" -o "${TARBALL}")
|
||||||
|
if [ "${NVM_DEBUG-}" = 1 ]; then
|
||||||
|
nvm_err "Download HTTP Status ${download_result}"
|
||||||
|
fi
|
||||||
|
if [ "${download_result}" != '200' ]; then
|
||||||
command rm -rf "${TARBALL}" "${tmpdir}"
|
command rm -rf "${TARBALL}" "${tmpdir}"
|
||||||
nvm_err "Binary download from ${TARBALL_URL} failed, trying source."
|
nvm_err "Binary download from ${TARBALL_URL} failed, trying source."
|
||||||
return 4
|
return 4
|
||||||
)
|
fi
|
||||||
|
|
||||||
if nvm_grep '404 Not Found' "${TARBALL}" >/dev/null; then
|
if nvm_grep '404 Not Found' "${TARBALL}" >/dev/null; then
|
||||||
command rm -rf "${TARBALL}" "${tmpdir}"
|
command rm -rf "${TARBALL}" "${tmpdir}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user