Version manager
Zig version manager
Using ZIG before 1.0 might require you to often switch between master and the last official release. Almost approximately every 3 months a new version is released.
One solution would be to install both (or more) versions of ZIG and switch the PATH environment variable to the version you want to use.
But the best solution is to use the ZIG Version Manager (ZVM), which is a tool that allows you to install and switch between different versions of ZIG.
We recommend using ZVM (stands for Zig Version Manager) which is a simple and easy to use tool.
Guide
Installing the tool:
curl https://raw.githubusercontent.com/tristanisham/zvm/master/install.sh | bash
echo "# ZVM" >> $HOME/.profile
echo export ZVM_INSTALL="$HOME/.zvm/self" >> $HOME/.profile
echo export PATH="$PATH:$HOME/.zvm/bin" >> $HOME/.profile
echo export PATH="$PATH:$ZVM_INSTALL/" >> $HOME/.profileListing all the versions available to download:
zvm ls --allDownloading a specific version:
zvm i masterDisplay all your downloaded versions:
zvm lsUse one of those versions:
zvm use masterThere are other commands available, you can check them by running:
zvm helpOr checking the ZVM repository.