Created
November 17, 2019 10:48
-
-
Save deingithub/5b1efdd8d97d945934296c2ea2275d11 to your computer and use it in GitHub Desktop.
Directly update to newest ziglang binary
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 | |
# requires sh, coreutils, curl, wget, jq, tar | |
# assumes ~/bin is in PATH | |
# zig tarball will be placed in ~/bin/zig-master/zig-commithash | |
# and the zig binary from there symlinked to ~/bin/zig | |
cd ~/bin | |
echo "deleting old symlink" | |
rm zig | |
echo "deleting old directory" | |
rm -rf zig-master | |
echo "downloading..." | |
mkdir zig-master | |
wget -O zig.tar.xz $(curl https://ziglang.org/download/index.json | jq -r ".master.\"x86_64-linux\".tarball") | |
echo "unpacking..." | |
tar -xvf zig.tar.xz -C zig-master | |
echo "deleting tarball" | |
rm zig.tar.xz | |
echo "creating symlink" | |
ln -s $(find zig-master/ -maxdepth 2 -name zig) zig | |
echo "done."⏎ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment