Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
[Fix] Update nvm_extract_tarball to support OpenBSD
Fixes #2660.
  • Loading branch information
opsbob authored and ljharb committed Dec 19, 2021
commit 79ad72d1160f83e4fa3778a0cb18ae0c1c693109
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