File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,7 +7,8 @@ TMP_DIR="${TMPDIR:-/tmp}/sudocheck-install"
77API_URL=" https://api.github.com/repos/$REPO /releases/latest"
88
99os=" $( uname -s | tr ' [:upper:]' ' [:lower:]' ) "
10- arch=" $( uname -m) "
10+ uname_arch=" $( uname -m) "
11+ arch=" $uname_arch "
1112
1213case " $os " in
1314 linux) ;;
@@ -33,7 +34,21 @@ archive_url="$(
3334 printf ' %s\n' " $release_json " |
3435 grep ' "browser_download_url":' |
3536 cut -d ' "' -f 4 |
36- grep " ${os} _${arch} .*\\ .tar\\ .gz$" |
37+ awk -v os=" $os " -v arch=" $arch " -v uname_arch=" $uname_arch " '
38+ function matches_arch(value) {
39+ return index(value, arch) > 0 ||
40+ index(value, uname_arch) > 0 ||
41+ (arch == "amd64" && index(value, "x86_64") > 0) ||
42+ (arch == "arm64" && index(value, "aarch64") > 0)
43+ }
44+ {
45+ value = tolower($0)
46+ if (index(value, os) > 0 && matches_arch(value) && value ~ /\.tar\.gz$/) {
47+ print $0
48+ exit
49+ }
50+ }
51+ ' |
3752 head -n 1
3853) "
3954checksum_url=" $(
You can’t perform that action at this time.
0 commit comments