Skip to content

Commit f189515

Browse files
committed
fixup
1 parent 6fc0742 commit f189515

File tree

3 files changed

+50
-220
lines changed

3 files changed

+50
-220
lines changed

.github/workflows/aio.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,16 @@ name: AllInOne
22

33
on:
44
push:
5-
paths-ignore:
6-
- '**.md'
5+
branches:
6+
- master
77
pull_request:
8-
paths-ignore:
9-
- '**.md'
10-
schedule:
11-
- cron: 0 0 * * 5
8+
branches:
9+
- master
10+
workflow_dispatch:
11+
12+
concurrency:
13+
group: ${{ github.ref }}-${{ github.workflow }}-checks
14+
cancel-in-progress: true
1215

1316
jobs:
1417
plugin_test:

bin/install.old

Lines changed: 0 additions & 210 deletions
This file was deleted.

lib/utils.bash

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ download_release() {
4444
filename="$2"
4545

4646
local platform_and_arch
47-
platform_and_arch="$(get_platform_and_arch)"
47+
platform_and_arch="$(get_platform_and_arch "${version}")"
4848
local ext
4949
ext="$(get_ext)"
5050
# https://github.com/tj-actions/auto-doc/releases/download/v2.7.1/auto-doc_2.7.1_Linux_x86_64.tar.gz
@@ -81,11 +81,48 @@ install_version() {
8181
)
8282
}
8383

84+
# from https://stackoverflow.com/questions/4023830/how-to-compare-two-strings-in-dot-separated-version-format-in-bash
85+
function vercomp() {
86+
if [[ "$1" == "$2" ]]; then
87+
return 0
88+
fi
89+
local IFS=.
90+
# shellcheck disable=SC2206
91+
local i ver1=($1) ver2=($2)
92+
# fill empty fields in ver1 with zeros
93+
for ((i = ${#ver1[@]}; i < ${#ver2[@]}; i++)); do
94+
ver1[i]=0
95+
done
96+
for ((i = 0; i < ${#ver1[@]}; i++)); do
97+
if [[ -z ${ver2[i]} ]]; then
98+
# fill empty fields in ver2 with zeros
99+
ver2[i]=0
100+
fi
101+
if ((10#${ver1[i]} > 10#${ver2[i]})); then
102+
return 1
103+
fi
104+
if ((10#${ver1[i]} < 10#${ver2[i]})); then
105+
return 2
106+
fi
107+
done
108+
return 0
109+
}
110+
84111
function get_platform_and_arch() {
112+
local _v=${1?}
113+
85114
local arch
86115
arch="$(get_arch)"
87116
local platform
88117
platform="$(get_platform)"
118+
119+
if [[ "${arch}" == "x86_64" ]]; then
120+
vercomp "${_v}" "0.26.0"
121+
case $? in
122+
2) arch="musl" ;;
123+
esac
124+
fi
125+
89126
local platform_and_arch
90127
if [[ "${platform}" == "mac" ]] || [[ "${platform}" == "win" ]]; then
91128
platform_and_arch="${platform}"
@@ -101,14 +138,14 @@ get_arch() {
101138
arm64)
102139
arch='arm64'
103140
;;
104-
arm6)
105-
arch='arm6'
141+
arm7)
142+
arch='armv7'
106143
;;
107144
x86_64)
108145
arch='x86_64'
109146
;;
110147
aarch64)
111-
arch='arm64'
148+
arch='aarch64'
112149
;;
113150
i386)
114151
arch='i386'

0 commit comments

Comments
 (0)