From ec2c2680829ff27f3e20dffe1e2dc0d9a04aceed Mon Sep 17 00:00:00 2001 From: Benjamin Lupton Date: Fri, 18 Aug 2023 16:54:29 +0800 Subject: [PATCH] setup-util-sd: fix missing arch, support arm arm support thanks to @yhakbar via https://github.com/chmln/sd/issues/152#issuecomment-1508728688 --- commands/setup-util-sd | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/commands/setup-util-sd b/commands/setup-util-sd index 458ecb5a1..9b76a5709 100755 --- a/commands/setup-util-sd +++ b/commands/setup-util-sd @@ -10,6 +10,13 @@ # arm64 # https://github.com/chmln/sd/issues/152 +# https://github.com/yhakbar/sd/releases/tag/v0.7.7-yhakbar +# sd-v0.7.7-yhakbar-aarch64-apple-darwin +# sd-v0.7.7-yhakbar-aarch64-unknown-linux-musl +# sd-v0.7.7-yhakbar-arm-unknown-linux-gnueabihf +# sd-v0.7.7-yhakbar-x86_64-apple-darwin +# sd-v0.7.7-yhakbar-x86_64-unknown-linux-gnu +# sd-v0.7.7-yhakbar-x86_64-unknown-linux-musl function setup_util_sd() ( source "$DOROTHY/sources/bash.bash" @@ -32,10 +39,11 @@ function setup_util_sd() ( RPM='sd' XBPS='sd' ) + arch="$(get-arch)" function get_github_asset_url { github-download \ --dry \ - --slug='chmln/sd' \ + --slug='yhakbar/sd' \ --release='latest' \ --asset-filter="$(echo-escape-regex "$1")$" | echo-first-line || : } @@ -45,10 +53,16 @@ function setup_util_sd() ( ) } if is-mac; then - add_download_option '-x86_64-apple-darwin' + if test "$arch" = 'a64'; then + add_download_option '-aarch64-apple-darwin' + else + add_download_option '-x86_64-apple-darwin' + fi else arch="$(get-arch)" - if test "$arch" = 'x64'; then + if test "$arch" = 'a64'; then + add_download_option '-aarch64-unknown-linux-musl' + elif test "$arch" = 'x64'; then add_download_option '-x86_64-unknown-linux-musl' fi fi