Last active
December 3, 2024 12:56
-
-
Save jackielii/2d58348960cda678cd935988d78ce6aa to your computer and use it in GitHub Desktop.
direnv `use zig {version}` via `zigup`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use_zig() { | |
if [ -z "$1" ]; then | |
log_status "No Zig version specified, using master" | |
version="master" | |
else | |
version="$1" | |
fi | |
export ZIG_HOME="$HOME/zig/$version/files" | |
if [ ! -d "$ZIG_HOME" ]; then | |
log_status "Zig $version not found at $ZIG_HOME, downloading" | |
zigup fetch $version | |
fi | |
if [ ! -d "$ZIG_HOME" ]; then | |
log_error "Failed to download Zig $version" | |
return 1 | |
fi | |
export PATH="$ZIG_HOME:$PATH" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use zig 0.13.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment