download the right Linux binary

This commit is contained in:
Brian Hicks 2023-04-26 16:20:52 -05:00
parent 4383d50828
commit 5c488ef4b6
No known key found for this signature in database
GPG Key ID: C4F324B9CAAB0D50

View File

@ -1,12 +1,28 @@
#!/usr/bin/env bash
cd $(git rev-parse --show-toplevel)
if ! test -d buck-out; then
mkdir buck-out
fi
if ! test -f buck-out/buck2; then
# TODO: adjust download location for different os/arch combinations
curl -L https://github.com/facebook/buck2/releases/download/latest/buck2-aarch64-apple-darwin.zst | zstd -d > buck-out/buck2
case "$(uname -s)" in
Darwin)
# TODO: adjust for processor type
curl -L https://github.com/facebook/buck2/releases/download/latest/buck2-aarch64-apple-darwin.zst | zstd -d > buck-out/buck2
;;
Linux)
curl -L https://github.com/facebook/buck2/releases/download/latest/buck2-x86_64-unknown-linux-gnu.zst | zstd -d > buck-out/buck2
;;
*)
echo "I don't know how to get a download for $(uname -s)"
exit 1
;;
esac
chmod +x buck-out/buck2
fi