4thel00z/zig-installer
zig-installer, installs any recent zig version for you, straight from the zig homepage. Written in go.
zig-installer
A cli for installing the Zig compiler. It automatically downloads, verifies, and installs Zig from official releases with support for custom installation paths and multiple versions.
go install github.com/4thel00z/zig-installer/...@latest
sudo zig-installer
This will grab the latest master version and install it to /usr/local
.
sudo zig-installer --version=0.11.0
sudo zig-installer \
--bin-dir=/opt/zig/bin \
--lib-dir=/opt/zig/lib
export ZIG_VERSION=0.11.0
export ZIG_BIN_DIR=/opt/zig/bin
export ZIG_LIB_DIR=/opt/zig/lib
sudo zig-installer
Flag | Environment Variable | Default | Description |
---|---|---|---|
--version |
ZIG_VERSION |
master | Version to install |
--bin-dir |
ZIG_BIN_DIR |
/usr/local/bin | Binary installation path |
--lib-dir |
ZIG_LIB_DIR |
/usr/local/lib | Library installation path |
--tar-dest |
ZIG_TAR_DEST |
/tmp/zig.tar.xz | Download location |
--dest |
ZIG_DEST |
/tmp/zig | Temporary extraction path |
--index-url |
ZIG_INDEX_URL |
ziglang.org/... | Download index URL |
π‘ info: found existing file, checking checksum...
β
success: existing file matches checksum, skipping download
π step: extracting...
π step: installing...
π step: cleaning up...
β
success: Zig 0.11.0 installed successfully! π
# Run with sudo for system directories
sudo zig-installer
# Install to user-owned directory
zig-installer --bin-dir=$HOME/.local/bin --lib-dir=$HOME/.local/lib
This project is licensed under the GPL-3 license.