Skip to content

Commit

Permalink
[Fix] Update nvm_extract_tarball to support OpenBSD
Browse files Browse the repository at this point in the history
Fixes #2660.
  • Loading branch information
opsbob authored and ljharb committed Dec 19, 2021
1 parent ccd442d commit 79ad72d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion nvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2270,7 +2270,15 @@ nvm_extract_tarball() {
tar='gtar'
fi

command "${tar}" -x${tar_compression_flag}f "${TARBALL}" -C "${TMPDIR}" --strip-components 1 || return 1
if [ "${NVM_OS}" = 'openbsd' ]; then
if [ "${tar_compression_flag}" = 'J' ]; then
command xzcat "${TARBALL}" | "${tar}" -xf - -C "${TMPDIR}" -s '/[^\/]*\///' || return 1
else
command "${tar}" -x${tar_compression_flag}f "${TARBALL}" -C "${TMPDIR}" -s '/[^\/]*\///' || return 1
fi
else
command "${tar}" -x${tar_compression_flag}f "${TARBALL}" -C "${TMPDIR}" --strip-components 1 || return 1
fi
}

nvm_get_make_jobs() {
Expand Down

0 comments on commit 79ad72d

Please sign in to comment.