File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3089,7 +3089,39 @@ nvm_supports_source_options() {
30893089}
30903090
30913091nvm_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 ; then
3093+ return 1
3094+ fi
3095+
3096+ # all node versions v4.0.0 and later have xz
3097+ if nvm_is_merged_node_version " ${1} " ; then
3098+ return 0
3099+ fi
3100+
3101+ # 0.12x: node v0.12.10 and later have xz
3102+ if nvm_version_greater_than_or_equal_to " ${1} " " 0.12.10" \
3103+ && nvm_version_greater " 0.13.0" " ${1} " ; then
3104+ return 0
3105+ fi
3106+
3107+ # 0.10x: node v0.10.42 and later have xz
3108+ if nvm_version_greater_than_or_equal_to " $1 " " 0.10.42" \
3109+ && nvm_version_greater " 0.11.0" " $1 " ; then
3110+ return 0
3111+ fi
3112+
3113+ local NVM_OS
3114+ NVM_OS=" $( nvm_get_os) "
3115+ case " ${NVM_OS} " in
3116+ darwin)
3117+ # darwin only has xz for io.js v2.3.2 and later
3118+ 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+ esac
3124+ return $?
30933125}
30943126
30953127nvm_auto () {
You can’t perform that action at this time.
0 commit comments