Last active
June 10, 2023 10:41
-
-
Save Artheg/75382e4b62be4e4ad7e099ec36bb7609 to your computer and use it in GitHub Desktop.
Update zig
This file contains 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
#!/bin/sh | |
ZIG_INSTALL_DIR=$HOME/.zig | |
printf "This will remove $ZIG_INSTALL_DIR. Continue? (y/n)" | |
read answer | |
if [ "$answer" != "${answer#[Yy]}" ] ;then | |
echo "Updating zig..." | |
else | |
exit | |
fi | |
rm -rf $ZIG_INSTALL_DIR | |
mkdir -p $ZIG_INSTALL_DIR | |
cd $ZIG_INSTALL_DIR | |
TAR_URL=$(curl "https://ziglang.org/download/index.json" | jq --raw-output ".master[\"x86_64-linux\"].tarball") | |
curl -LO $TAR_URL | |
tar -xvf $(basename $TAR_URL) --strip-components=1 | |
zig version |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment