dev-env/zig/setup_zig.sh
2025-03-28 16:38:07 +00:00

13 lines
424 B
Bash
Executable file

#!/bin/sh
echo "Requires curl, jq, wget and tar."
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
if [ "$OS" = "linux" ]; then
OS="x86_64-linux"
elif [ "$OS" = "darwin" ]; then
OS="x86_64-macos"
elif [ "$OS" = "mingw64_nt" ] || [ "$OS" = "cygwin" ]; then
OS="x86_64-windows"
fi
curl https://ziglang.org/download/index.json | jq -r ".master.[\"$OS\"].tarball" | wget -O zig-master.tar.xz -i -
tar xvf ./zig-master.tar.xz