Skip to content

Commit

Permalink
fix: Improve uncompress command (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
nyuyuyu authored Oct 14, 2023
1 parent 31424c8 commit 402c702
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion bin/download
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ release_file="$ASDF_DOWNLOAD_PATH/$TOOL_NAME-$ASDF_INSTALL_VERSION.$(platform_ex
download_release "$ASDF_INSTALL_VERSION" "$release_file"

# Extract contents of tar.gz file into the download directory
tar "$(tar_decompression_option)" "$release_file" -C "$ASDF_DOWNLOAD_PATH" --strip-components=1 || fail "Could not extract $release_file"
$(platform_tar) -xf "$release_file" -C "$ASDF_DOWNLOAD_PATH" --strip-components=1 || fail "Could not extract $release_file"

# Remove the tar.gz file since we don't need to keep it
rm "$release_file"
8 changes: 4 additions & 4 deletions lib/utils.bash
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ platform_extension() {
esac
}

tar_decompression_option() {
platform_tar() {
case "$(uname -s)" in
"Linux")
echo "-xJf"
"Darwin")
echo "bsdtar"
;;
*)
echo "-xzf"
echo "tar"
;;
esac
}
Expand Down

0 comments on commit 402c702

Please sign in to comment.