An installer script for zig, Written in Bun Javascript.
- Fetches the release data from the official zig website
- Obtains the build target for the current machine
- Checks for an existing clone of the latest download -> If yes, Jumps directly to Step 5.
- Downloads and extracts the latest release
- Copies the latest release to the current user's home directory.
- Quits; If there are no errors, A
zig/
directory should be created on your home directory.
To add zig to path after running this script, You have to add this line to your rc file:
export PATH=$PATH:~/zig
Or, To ease your work, Run this:
curl https://raw.githubusercontent.com/MinecraftPublisher/zig-build/master/path.sh | $0
(This will download and run the script below)
Or, Run this script to add it directly to your rc file:
# Detect shell
echo Detecting current shell...
SHELL=""
for i in $(echo $0 | tr "/" "\n"); do
SHELL=$i
done
RC="$HOME/.${SHELL}rc"
echo RC Path: $RC
echo 'export PATH=$PATH:~/zig' >> $RC
echo Done!