File tree Expand file tree Collapse file tree 2 files changed +24
-4
lines changed Expand file tree Collapse file tree 2 files changed +24
-4
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ release_file="$ASDF_DOWNLOAD_PATH/$TOOL_NAME-$ASDF_INSTALL_VERSION.tar.gz"
1717download_release " $ASDF_INSTALL_VERSION " " $release_file "
1818
1919# Extract contents of tar.gz file into the download directory
20- tar -xzf " $release_file " -C " $ASDF_DOWNLOAD_PATH " --strip-components=1 || fail " Could not extract $release_file "
20+ tar -xzf " $release_file " -C " $ASDF_DOWNLOAD_PATH " || fail " Could not extract $release_file "
2121
2222# Remove the tar.gz file since we don't need to keep it
2323rm " $release_file "
Original file line number Diff line number Diff line change 22
33set -euo pipefail
44
5- GH_REPO=" https://github.com/tufin /oasdiff"
5+ GH_REPO=" https://github.com/Tufin /oasdiff"
66TOOL_NAME=" oasdiff"
77TOOL_TEST=" oasdiff --help"
88
@@ -36,17 +36,37 @@ list_all_versions() {
3636}
3737
3838download_release () {
39- local version filename url
39+ local version filename url platform
4040 version=" $1 "
4141 filename=" $2 "
42+ platform=$( get_platform)
4243
4344 # TODO: Adapt the release URL convention for oasdiff
44- url=" $GH_REPO /archive/ v${version} .tar.gz"
45+ url=" $GH_REPO /releases/download/ v${version} / ${TOOL_NAME} _ ${version} _ $platform .tar.gz"
4546
4647 echo " * Downloading $TOOL_NAME release $version ..."
4748 curl " ${curl_opts[@]} " -o " $filename " -C - " $url " || fail " Could not download $url "
4849}
4950
51+ get_platform () {
52+ local version=$1
53+
54+ case $( uname) in
55+ # Linux OS
56+ Linux)
57+ if [ " $( uname -m) " = " aarch64" ]; then
58+ echo " linux-arm64"
59+ else
60+ echo " linux-amd64"
61+ fi
62+ ;;
63+ # Mac OS
64+ Darwin)
65+ echo " darwin_all"
66+ ;;
67+ esac
68+ }
69+
5070install_version () {
5171 local install_type=" $1 "
5272 local version=" $2 "
You can’t perform that action at this time.
0 commit comments