Skip to content
 
 

Latest commit

 

History

34 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

asdf-zig (fork with custom version support)

Zig plugin for the asdf version manager.

As a bonus, this plugin supports installing zls as well, so zls and zig version can match exactly.

This fork adds support for custom zig versions and master version installation.

Dependencies

Install

After installing asdf, install the plugin by running:

asdf plugin remove zig  # Remove official plugin if installed
asdf plugin add zig https://github.com/liyu1981/asdf-zig.git

or update an existing installation:

asdf plugin update zig

Then use asdf-zig to manage zig:

# Show all installable versions
asdf list all zig

# Install specific version

asdf install zig 0.16.0

# or install latest tagged version with
asdf install zig latest

# Set a version globally (on your ~/.tool-versions file)
asdf set --home zig latest

# Now zig commands are available
zig version

# You can also check the ZLS version.
# It is designed to be highly compatible with the specific Zig version you installed.
zls version

Check asdf readme for more instructions on how to install & manage versions.

Custom Versions

This fork supports installing custom zig versions that are not in the official release index.

Why?

The official asdf-zig can only support versions listed at https://ziglang.org/download/index.json. But zig evolves fast, and sometimes you need to stick with a specific dev version like 0.12.0-dev.2139+e025ad7b4.

How to use custom versions

  1. Create the custom versions directory and file:
mkdir -p ~/.asdf/custom/zig
echo '{"0.12.0-dev.2139+e025ad7b4": {}, "0.12.0-dev.1828+225fe6ddb": {}}' > ~/.asdf/custom/zig/versions.json
  1. Your custom versions will now appear in asdf list all zig and can be installed with asdf install zig <version>.

Installing master version

You can also install the current master version of zig:

asdf list all zig  # Shows master_<version> at the end
asdf install zig master_<version>

The master version is prefixed with master_ to distinguish it from release versions.

License

Apache License 2.0

About

Zig plugin for the asdf version manager

Topics

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages