zig-installer

command module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 15, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

README ΒΆ

zig-installer

GPL-3 License

What this project is about

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.

Installation

go install github.com/4thel00z/zig-installer/...@latest

Usage Examples

Basic Installation
sudo ./zig-installer

This will grab the latest master version and install it to /usr/local.

Install Specific Version
sudo ./zig-installer --version=0.11.0
Custom Installation Path
sudo ./zig-installer \
  --bin-dir=/opt/zig/bin \
  --lib-dir=/opt/zig/lib
Using Environment Variables
export ZIG_VERSION=0.11.0
export ZIG_BIN_DIR=/opt/zig/bin
export ZIG_LIB_DIR=/opt/zig/lib
sudo ./zig-installer

Configuration Options

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

Features

  • πŸš€ Fast downloads
  • πŸ“¦ Proper library installation
  • πŸ”§ Highly configurable
  • πŸ–₯️ Cross-platform support
  • πŸ” Checksum verification

Sample Output

πŸ’‘ 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! πŸŽ‰

Troubleshooting

Permission Errors
# Run with sudo for system directories
sudo ./zig-installer
Custom Location Without Root
# Install to user-owned directory
./zig-installer --bin-dir=$HOME/.local/bin --lib-dir=$HOME/.local/lib

License

This project is licensed under the GPL-3 license.

Documentation ΒΆ

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL