Provides use zig function for use with zvm
direnvrc | ||
LICENSE | ||
README.md |
zvm-direnv
Installing
Put the following lines in your .envrc
:
if ! has zvm_direnv_version || ! zvm_direnv_version 1.0.0; then
source_url "https://git.lerch.org/lobo/zvm-direnv/raw/tag/1.0.0/direnvrc" "sha256-Gtddvcr6aJsrjKd53uChxA1reQmJgEBpmPUWmMdtDIQ="
fi
Usage
$ echo "use zig 0.13.0" >> .envrc
$ direnv allow
If you haven't used direnv before, make sure to hook it into your shell first.
How it works
This implementation utilizes zvm for installation of both zig
and zls. It avoids the use of zvm use
as
this will change the zig version system-wide, possibly resulting in some
confusing behavior. Instead, it uses zvm to download the appropriate versions
if necessary, then prepends the desired version to the path used in the direnv
directory.