Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/sh
- NOW=$(date -Iseconds)
- VERSIONS="/tmp/zig-versions-$NOW"
- DOWNLOAD="/tmp/zig-download-$NOW"
- curl -s https://ziglang.org/download/index.json > $VERSIONS
- VERSION=$(jq '.master."x86_64-linux".tarball' $VERSIONS | sed 's/.*\(zig.*\)\.tar.xz.*/\1/g')
- echo "installing $VERSION"
- LINUX_BIN=$(jq '.master."x86_64-linux".tarball' $VERSIONS | tr -d "\"")
- curl -s $LINUX_BIN > $DOWNLOAD
- cd /tmp
- tar xf $DOWNLOAD
- cd $OLDPWD
- cp "/tmp/$VERSION/zig" "$HOME/bin"
- cp -r "/tmp/$VERSION/lib/zig" "$HOME/lib"
- echo done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement