Skip to content

Instantly share code, notes, and snippets.

@Artheg
Last active June 10, 2023 10:41
Show Gist options
  • Save Artheg/75382e4b62be4e4ad7e099ec36bb7609 to your computer and use it in GitHub Desktop.
Save Artheg/75382e4b62be4e4ad7e099ec36bb7609 to your computer and use it in GitHub Desktop.
Update zig
#!/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