Skip to content
Myr

[New] expand `xz` support to more versions.

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Per https://github.com/nodejs/node/pull/4894#issuecomment-175989848

authored by Jordan Harband · committed by Jordan Harband · parent 6784767 · Browse files · 1 file+33 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+33 added−1 removed

  • other:+33 added−1 removed

1 file+33 added−1 removed

modified:nvm.sh+33 added-1 removed
3087 unmodified lines
3088 [ "_$(echo '[ $# -gt 0 ] && echo $1' | . /dev/stdin yes 2> /dev/null)" = "_yes" ]3089}30903091nvm_supports_xz() {3092 command which xz >/dev/null 2>&1 && nvm_version_greater_than_or_equal_to "$1" "2.3.2"3092 if [ -z "${1-}" ] || ! command which xz >/dev/null 2>&1; then3093 return 13094 fi30953096 # all node versions v4.0.0 and later have xz3097 if nvm_is_merged_node_version "${1}"; then3098 return 03099 fi31003101 # 0.12x: node v0.12.10 and later have xz3102 if nvm_version_greater_than_or_equal_to "${1}" "0.12.10" \3103 && nvm_version_greater "0.13.0" "${1}"; then3104 return 03105 fi31063107 # 0.10x: node v0.10.42 and later have xz3108 if nvm_version_greater_than_or_equal_to "$1" "0.10.42" \3109 && nvm_version_greater "0.11.0" "$1"; then3110 return 03111 fi31123113 local NVM_OS3114 NVM_OS="$(nvm_get_os)"3115 case "${NVM_OS}" in3116 darwin)3117 # darwin only has xz for io.js v2.3.2 and later3118 nvm_version_greater_than_or_equal_to "${1}" "2.3.2"3119 ;;3120 *)3121 nvm_version_greater_than_or_equal_to "${1}" "1.0.0"3122 ;;3123 esac3124 return $?3125}31263127nvm_auto() {3128 local NVM_MODE
41 unmodified lines