File tree 2 files changed +14
-7
lines changed
2 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,11 @@ release_file="$ASDF_DOWNLOAD_PATH/$TOOL_NAME-$ASDF_INSTALL_VERSION.${ext}"
19
19
download_release " $ASDF_INSTALL_VERSION " " $release_file "
20
20
21
21
# Extract contents of tar.gz file into the download directory
22
- tar -xvzf " $release_file " -C " $ASDF_DOWNLOAD_PATH " || fail " Could not extract $release_file "
22
+ if [[ " $ASDF_INSTALL_VERSION " < " 0.5.0" ]]; then
23
+ tar -xvzf " $release_file " -C " $ASDF_DOWNLOAD_PATH " || fail " Could not extract $release_file "
24
+ else
25
+ tar --strip-components=1 -xvzf " $release_file " -C " $ASDF_DOWNLOAD_PATH " || fail " Could not extract $release_file "
26
+ fi
23
27
24
28
# Remove the tar.gz file since we don't need to keep it
25
29
rm " $release_file "
Original file line number Diff line number Diff line change @@ -84,14 +84,17 @@ download_release() {
84
84
architecture=" $( arch) "
85
85
os=$( get_os)
86
86
ext=$( get_ext)
87
- if [ " $os " == " apple-darwin" ]; then
88
- if [ " $architecture " == " arm64" ]; then
89
- architecture=" aarch64"
90
- fi
87
+ if [ " $os " == " apple-darwin" ]; then
88
+ if [ " $architecture " == " arm64" ]; then
89
+ architecture=" aarch64"
90
+ fi
91
91
fi
92
-
93
92
94
- url=" $GH_REPO /releases//download/v${version} /$TOOL_NAME -${version} -${architecture} -${os} .${ext} "
93
+ if [[ " $version " < " 0.5.0" ]]; then
94
+ url=" $GH_REPO /releases//download/v${version} /$TOOL_NAME -${version} -${architecture} -${os} .${ext} "
95
+ else
96
+ url=" $GH_REPO /releases//download/${version} /$TOOL_NAME -${architecture} -${os} .${ext} "
97
+ fi
95
98
96
99
echo " * Downloading $TOOL_NAME release $version ..."
97
100
curl " ${curl_opts[@]} " -o " $filename " -C - " $url " || fail " Could not download $url "
You can’t perform that action at this time.
0 commit comments