mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-05-17 17:41:50 +00:00
Compare commits
3 Commits
d79348b30e
...
40c625afb0
Author | SHA1 | Date | |
---|---|---|---|
![]() |
40c625afb0 | ||
![]() |
99352a64d2 | ||
![]() |
996ae54fde |
@ -106,7 +106,7 @@ nvm_node_version() {
|
||||
|
||||
nvm_download() {
|
||||
if nvm_has "curl"; then
|
||||
curl --fail --compressed -q "$@"
|
||||
command curl --fail --compressed -q "$@"
|
||||
elif nvm_has "wget"; then
|
||||
# Emulate curl with wget
|
||||
ARGS=$(nvm_echo "$@" | command sed -e 's/--progress-bar /--progress=bar /' \
|
||||
|
18
nvm.sh
18
nvm.sh
@ -101,7 +101,7 @@ nvm_get_latest() {
|
||||
if nvm_curl_use_compression; then
|
||||
CURL_COMPRESSED_FLAG="--compressed"
|
||||
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
|
||||
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
|
||||
@ -133,7 +133,7 @@ nvm_download() {
|
||||
for arg in "$@"; do
|
||||
NVM_DOWNLOAD_ARGS="${NVM_DOWNLOAD_ARGS} \"$arg\""
|
||||
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
|
||||
# Emulate curl with wget
|
||||
ARGS=$(nvm_echo "$@" | command sed "
|
||||
@ -356,19 +356,19 @@ nvm_install_latest_npm() {
|
||||
if [ $NVM_IS_19_OR_ABOVE -eq 1 ] && nvm_version_greater_than_or_equal_to "${NODE_VERSION}" 20.5.0; then
|
||||
NVM_IS_20_5_OR_ABOVE=1
|
||||
fi
|
||||
local NVM_IS_20_17_or_ABOVE
|
||||
NVM_IS_20_17_or_ABOVE=0
|
||||
if [ $NVM_IS_20_5_OR_ABOVE -eq 1 ] && nvm_version_greater 20.17.0 "${NODE_VERSION}"; then
|
||||
NVM_IS_20_17_or_ABOVE=1
|
||||
local NVM_IS_20_17_OR_ABOVE
|
||||
NVM_IS_20_17_OR_ABOVE=0
|
||||
if [ $NVM_IS_20_5_OR_ABOVE -eq 1 ] && nvm_version_greater_than_or_equal_to "${NODE_VERSION}" 20.17.0; then
|
||||
NVM_IS_20_17_OR_ABOVE=1
|
||||
fi
|
||||
local NVM_IS_21_OR_ABOVE
|
||||
NVM_IS_21_OR_ABOVE=0
|
||||
if [ $NVM_IS_20_17_or_ABOVE -eq 1 ] && nvm_version_greater 21.0.0 "${NODE_VERSION}"; then
|
||||
if [ $NVM_IS_20_17_OR_ABOVE -eq 1 ] && nvm_version_greater_than_or_equal_to "${NODE_VERSION}" 21.0.0; then
|
||||
NVM_IS_21_OR_ABOVE=1
|
||||
fi
|
||||
local NVM_IS_22_9_OR_ABOVE
|
||||
NVM_IS_22_9_OR_ABOVE=0
|
||||
if [ $NVM_IS_21_OR_ABOVE -eq 1 ] && nvm_version_greater 22.9.0 "${NODE_VERSION}"; then
|
||||
if [ $NVM_IS_21_OR_ABOVE -eq 1 ] && nvm_version_greater_than_or_equal_to "${NODE_VERSION}" 22.9.0; then
|
||||
NVM_IS_22_9_OR_ABOVE=1
|
||||
fi
|
||||
|
||||
@ -420,7 +420,7 @@ nvm_install_latest_npm() {
|
||||
nvm_echo '* `npm` `v9.x` is the last version that works on `node` `< v18.17`, `v19`, or `v20.0` - `v20.4`'
|
||||
$NVM_NPM_CMD install -g npm@9
|
||||
elif \
|
||||
[ $NVM_IS_20_17_or_ABOVE -eq 0 ] \
|
||||
[ $NVM_IS_20_17_OR_ABOVE -eq 0 ] \
|
||||
|| { [ $NVM_IS_21_OR_ABOVE -eq 1 ] && [ $NVM_IS_22_9_OR_ABOVE -eq 0 ]; } \
|
||||
; then
|
||||
nvm_echo '* `npm` `v10.x` is the last version that works on `node` `< v20.17`, `v21`, or `v22.0` - `v22.8`'
|
||||
|
Loading…
Reference in New Issue
Block a user