Skip to content

Commit 071824e

Browse files
authored
🤖 Sync org-wide files to upstream repo (#393)
More info: exercism/org-wide-files@0328994
1 parent b2d2aee commit 071824e

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

‎bin/fetch-configlet

+12-11
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,11 @@ get_download_url() {
2424
local latest='https://api.github.com/repos/exercism/configlet/releases/latest'
2525
local arch
2626
case "$(uname -m)" in
27-
x86_64) arch='x86-64' ;;
28-
*686*) arch='i386' ;;
29-
*386*) arch='i386' ;;
30-
*) arch='x86-64' ;;
27+
aarch64|arm64) arch='arm64' ;;
28+
x86_64) arch='x86-64' ;;
29+
*686*) arch='i386' ;;
30+
*386*) arch='i386' ;;
31+
*) arch='x86-64' ;;
3132
esac
3233
local suffix="${os}_${arch}.${ext}"
3334
curl "${curlopts[@]}" --header 'Accept: application/vnd.github.v3+json' "${latest}" |
@@ -47,7 +48,7 @@ main() {
4748
fi
4849

4950
local os
50-
case "$(uname)" in
51+
case "$(uname -s)" in
5152
Darwin*) os='macos' ;;
5253
Linux*) os='linux' ;;
5354
Windows*) os='windows' ;;
@@ -58,8 +59,8 @@ main() {
5859

5960
local ext
6061
case "${os}" in
61-
windows*) ext='zip' ;;
62-
*) ext='tar.gz' ;;
62+
windows) ext='zip' ;;
63+
*) ext='tar.gz' ;;
6364
esac
6465

6566
echo "Fetching configlet..." >&2
@@ -69,16 +70,16 @@ main() {
6970
curl "${curlopts[@]}" --output "${output_path}" "${download_url}"
7071

7172
case "${ext}" in
72-
*zip) unzip "${output_path}" -d "${output_dir}" ;;
73-
*) tar xzf "${output_path}" -C "${output_dir}" ;;
73+
zip) unzip "${output_path}" -d "${output_dir}" ;;
74+
*) tar xzf "${output_path}" -C "${output_dir}" ;;
7475
esac
7576

7677
rm -f "${output_path}"
7778

7879
local executable_ext
7980
case "${os}" in
80-
windows*) executable_ext='.exe' ;;
81-
*) executable_ext='' ;;
81+
windows) executable_ext='.exe' ;;
82+
*) executable_ext='' ;;
8283
esac
8384

8485
local configlet_path="${output_dir}/configlet${executable_ext}"

0 commit comments

Comments
 (0)