Skip to content

liyu1981/asdf-zig

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

a fork of asdf-zig for supporting custom versions

why

The official asdf-zig can only support what versions are listed at https://ziglang.org/download/index.json, which are all versions either official or cutting-edge master. But as we know zig is evolving fast, sometime I need to stick with a specific version for a while, like 0.12.0-dev.2139+e025ad7b4. This is easy job if just download it and make it available to my path. But if there are multiple projects using different custom zig version, manual changing will be tedious.

So I start to miss asdf, the one shop for managing many different new language runtimes, and luckily there is asdf-zig, but unluckily it supports no custom versions.

So I just make my fork and adjust it a bit for my usage.

how it works

essentially my fork replaces the official asdf-zig. To install it, need to remove the old one, just

asdf plugin remove asdf-zig
asdf plugin add zig https://github.com/liyu1981/asdf-zig.git

will replace your version with mine :)

then create a custom version file like below in ~/.asdf/custom/zig

mkdir -p ~/.asdf/custom/zig
echo "{\"0.12.0-dev.2139+e025ad7b4\": {}}" > ~/.asdf/custom/zig/versions.json

and after that you will find your custom version is available in asdf commands. See this demo video for how I use it in life

demo gif for asdf-zig with custom versions

what's the format for ~/.asdf/custom/zig/versions.json

currently it is just naive :)

{
  "0.12.0-dev.2139+e025ad7b4": {},
  "0.12.0-dev.1828+225fe6ddb": {},
  "<more zig dev versions>": {}
}

you get the idea, only the key part is relevant, the value part is not, so I just keep a simple '{}' to fool the underlying json parser (from original asdf-zig).

what if I want install cutting edge zig master?

commit a789504 added this feature! just do asdf list-all zig and asdf install zig <version>, like follows

list all zig including master version

install zig master version with asdf

I hope this helps!

original asdf-zig README.md

asdf-zig

Zig plugin for asdf version manager

Build History

Build history

Installation

asdf plugin-add zig https://github.com/asdf-community/asdf-zig.git

Usage

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

License

Licensed under the Apache License, Version 2.0.

About

Zig plugin for the asdf version manager

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 95.9%
  • Makefile 4.1%