Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion nvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4325,7 +4325,11 @@ nvm_supports_xz() {
if [ "_${NVM_OS}" = '_darwin' ]; then
local MACOS_VERSION
MACOS_VERSION="$(sw_vers -productVersion)"
if nvm_version_greater "10.9.0" "${MACOS_VERSION}"; then
if tar --version | command grep -q GNU && ! command which xz >/dev/null 2>&1; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if tar --version | command grep -q GNU && ! command which xz >/dev/null 2>&1; then
if command tar --version | command grep -q GNU && ! command which xz >/dev/null 2>&1; then

# On macOS with GNU tar in use, and no xv on the path, xv-compressed
# tarballs aren't supported
return 1
elif nvm_version_greater "10.9.0" "${MACOS_VERSION}"; then
# macOS 10.8 and earlier doesn't support extracting xz-compressed tarballs with tar
return 1
fi
Expand Down