fix: use rust target triple for arch in install-dust

dust's GitHub releases are named with aarch64/x86_64 (Rust target
triples), not uname -m's arm64/x86_64, so installs on Apple Silicon
downloaded a 404 body and failed with a tar "Unrecognized archive
format" error.
main
Buddy 4 days ago
parent 3fa38c362b
commit 3d4f8ba8a4

@ -10,7 +10,7 @@ VERSION=${VERSION:-1.2.6}
DEST=${XDG_DATA_HOME}/apps/releases/${APP} DEST=${XDG_DATA_HOME}/apps/releases/${APP}
main() ( main() (
URL=https://github.com/bootandy/dust/releases/download/v${VERSION}/dust-v${VERSION}-$(uname -m)-$(get_os).tar.gz URL=https://github.com/bootandy/dust/releases/download/v${VERSION}/dust-v${VERSION}-$(get_arch)-$(get_os).tar.gz
extract_tarball "${URL}" "${DEST}/${VERSION}" "--strip-component 1" extract_tarball "${URL}" "${DEST}/${VERSION}" "--strip-component 1"
set_current_link "${DEST}" "${VERSION}" set_current_link "${DEST}" "${VERSION}"
@ -28,4 +28,18 @@ get_os() (
esac esac
) )
# dust releases use Rust target triples, which differ from uname -m
get_arch() (
case $(uname -m) in
x86_64*) echo x86_64 ;;
amd64*) echo x86_64 ;;
arm64*) echo aarch64 ;;
aarch64*) echo aarch64 ;;
*)
echo >&2 "unsupported architecture: $(uname -m)"
exit 1
;;
esac
)
main "${@}" main "${@}"

Loading…
Cancel
Save