Created
September 12, 2024 18:50
-
-
Save zenspider/a72eafcca77c772f9e5164862432a63c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
# set -xv | |
DIR=/usr/local/opt/zig | |
if [ "$1" == "clean" ]; then | |
shift | |
echo "...from clean" | |
rm -rf $DIR | |
fi | |
mkdir -p $DIR | |
URL=$(curl -s https://ziglang.org/download/index.json | jq -r .\"${1:-master}\".\"aarch64-macos\".tarball) | |
echo $URL | |
curl -s $URL | tar -xC $DIR --hfsCompression --strip-components 1 | |
ln -sf ../opt/zig/zig /usr/local/bin/zig | |
zig version |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
KEEP