Skip to content

Instantly share code, notes, and snippets.

@sethaxen
Created January 20, 2024 09:14
Show Gist options
  • Save sethaxen/4934edf3da40e3d61384a1108d1528bd to your computer and use it in GitHub Desktop.
Save sethaxen/4934edf3da40e3d61384a1108d1528bd to your computer and use it in GitHub Desktop.
Download and set nightly channel on juliaup
#!/bin/bash
# Adapted from https://github.com/JuliaLang/juliaup/issues/96#issuecomment-1480110471
# Set variables for directories and files
JULIA_DIR="$HOME/.julia/juliaup/julia-nightly"
TMP_FILE="/tmp/julia-nightly.tar.gz"
JULIA_NIGHTLY_URL="https://julialangnightlies-s3.julialang.org/bin/linux/x86_64/julia-latest-linux-x86_64.tar.gz"
# Download the nightly Julia build
if wget -O $TMP_FILE $JULIA_NIGHTLY_URL; then
# Download successful; Remove the old nightly build
rm -rf $JULIA_DIR
# Set up the new nightly build
mkdir -p $JULIA_DIR
tar -xf $TMP_FILE -C $JULIA_DIR --strip-components=1
# Clean up temporary files
rm $TMP_FILE
echo "Julia nightly update successful."
# Allow linking to fail if already exists
juliaup link nightly "$JULIA_DIR/bin/julia" || true
else
# Download failed; report the error
echo "Error: Failed to download Julia nightly build."
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment