Skip to content

Instantly share code, notes, and snippets.

@zenspider
Created September 12, 2024 18:50
Show Gist options
  • Save zenspider/a72eafcca77c772f9e5164862432a63c to your computer and use it in GitHub Desktop.
Save zenspider/a72eafcca77c772f9e5164862432a63c to your computer and use it in GitHub Desktop.
#!/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
@zenspider
Copy link
Author

KEEP

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment