File tree 6 files changed +33
-8
lines changed
6 files changed +33
-8
lines changed Original file line number Diff line number Diff line change 20
20
uses : asdf-vm/actions/plugin-test@v2
21
21
with :
22
22
command : oasdiff --help
23
+ - name : asdf_plugin_test_1_10_23
24
+ uses : asdf-vm/actions/plugin-test@v2
25
+ with :
26
+ command : oasdiff --version
27
+ version : 1.10.23
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ set -euo pipefail
5
5
current_script_path=${BASH_SOURCE[0]}
6
6
plugin_dir=$( dirname " $( dirname " $current_script_path " ) " )
7
7
8
- # shellcheck source=../ lib/utils.bash
8
+ # shellcheck source=lib/utils.bash
9
9
source " ${plugin_dir} /lib/utils.bash"
10
10
11
11
mkdir -p " $ASDF_DOWNLOAD_PATH "
@@ -17,7 +17,7 @@ release_file="$ASDF_DOWNLOAD_PATH/$TOOL_NAME-$ASDF_INSTALL_VERSION.tar.gz"
17
17
download_release " $ASDF_INSTALL_VERSION " " $release_file "
18
18
19
19
# 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 "
21
21
22
22
# Remove the tar.gz file since we don't need to keep it
23
23
rm " $release_file "
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ set -euo pipefail
5
5
current_script_path=${BASH_SOURCE[0]}
6
6
plugin_dir=$( dirname " $( dirname " $current_script_path " ) " )
7
7
8
- # shellcheck source=../ lib/utils.bash
8
+ # shellcheck source=lib/utils.bash
9
9
source " ${plugin_dir} /lib/utils.bash"
10
10
11
11
install_version " $ASDF_INSTALL_TYPE " " $ASDF_INSTALL_VERSION " " $ASDF_INSTALL_PATH "
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ set -euo pipefail
5
5
current_script_path=${BASH_SOURCE[0]}
6
6
plugin_dir=$( dirname " $( dirname " $current_script_path " ) " )
7
7
8
- # shellcheck source=../ lib/utils.bash
8
+ # shellcheck source=lib/utils.bash
9
9
. " ${plugin_dir} /lib/utils.bash"
10
10
11
11
curl_opts=(-sI)
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ set -euo pipefail
5
5
current_script_path=${BASH_SOURCE[0]}
6
6
plugin_dir=$( dirname " $( dirname " $current_script_path " ) " )
7
7
8
- # shellcheck source=../ lib/utils.bash
8
+ # shellcheck source=lib/utils.bash
9
9
source " ${plugin_dir} /lib/utils.bash"
10
10
11
11
list_all_versions | sort_versions | xargs echo
Original file line number Diff line number Diff line change 2
2
3
3
set -euo pipefail
4
4
5
- ] GH_REPO=" https://github.com/tufin /oasdiff"
5
+ GH_REPO=" https://github.com/Tufin /oasdiff"
6
6
TOOL_NAME=" oasdiff"
7
7
TOOL_TEST=" oasdiff --help"
8
8
@@ -36,17 +36,37 @@ list_all_versions() {
36
36
}
37
37
38
38
download_release () {
39
- local version filename url
39
+ local version filename url platform
40
40
version=" $1 "
41
41
filename=" $2 "
42
+ platform=$( get_platform " $version " )
42
43
43
44
# 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"
45
46
46
47
echo " * Downloading $TOOL_NAME release $version ..."
47
48
curl " ${curl_opts[@]} " -o " $filename " -C - " $url " || fail " Could not download $url "
48
49
}
49
50
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
+
50
70
install_version () {
51
71
local install_type=" $1 "
52
72
local version=" $2 "
You can’t perform that action at this time.
0 commit comments