Skip to content

Commit

Permalink
setup-util-sd: fix missing arch, support arm
Browse files Browse the repository at this point in the history
arm support thanks to @yhakbar via chmln/sd#152 (comment)
  • Loading branch information
balupton committed Aug 18, 2023
1 parent 18e6851 commit ec2c268
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions commands/setup-util-sd
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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 || :
}
Expand All @@ -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
Expand Down

0 comments on commit ec2c268

Please sign in to comment.