Skip to content

Instantly share code, notes, and snippets.

@00-matt
Last active March 11, 2021 17:46
Show Gist options
  • Save 00-matt/2041b98900a96b1d1a5c04c189a20caf to your computer and use it in GitHub Desktop.
Save 00-matt/2041b98900a96b1d1a5c04c189a20caf to your computer and use it in GitHub Desktop.
RuneLite Launcher
#!/bin/sh
set -e
set -u
CONFIG_DIR="$HOME/.config/runelite-${1:-main}"
RUNELITE_DIR="$HOME/src/runelite"
cd "$RUNELITE_DIR"
git fetch
CURRENT_VERSION=$(git describe)
LATEST_VERSION=$(git describe --tags $(git rev-list --tags --max-count=1))
printf 'Current: %s\nLatest: %s\n' "$CURRENT_VERSION" "$LATEST_VERSION"
if [ "$CURRENT_VERSION" = "$LATEST_VERSION" ]; then
echo 'Up to date.'
else
echo 'Updating.'
git checkout $LATEST_VERSION
mvn -DskipTests -T1C clean package --projects runelite-client --auto-make
fi
JAR_NAME="client-$(echo "$LATEST_VERSION" | cut -d'-' -f3)-shaded.jar"
exec java \
-ea \
-Duser.home="$CONFIG_DIR" \
-jar "$RUNELITE_DIR/runelite-client/target/$JAR_NAME" \
--developer-mode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment