Skip to content

Instantly share code, notes, and snippets.

@danthedaniel
Last active January 3, 2017 14:18
Show Gist options
  • Save danthedaniel/91f30da63a464feb79a8 to your computer and use it in GitHub Desktop.
Save danthedaniel/91f30da63a464feb79a8 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Author: teaearlgraycold
# Builds Spigot.jar and places it in the current directory.
CURRENTDIR=`pwd`
BUILDDIR=/tmp/spigot-buildtools
if ! [ -x "$(command -v git)" ]; then
echo "Installing git"
sudo apt-get update
sudo apt-get install git
fi
mkdir "$BUILDDIR"
cd "$BUILDDIR"
echo "Downloading Spigot BuildTools"
wget https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar -O "$BUILDDIR/BuildTools.jar"
echo "Running BuildTools. This will take a while."
sleep 2
if [ `git config --global core.autocrlf` ]; then
echo "Unsetting AutoCLRF in GIT"
git config --global --unset core.autocrlf
fi
java -jar "$BUILDDIR/BuildTools.jar"
if [ -f "$BUILDDIR"/spigot-*.jar ]; then
mv "$BUILDDIR"/spigot-*.jar "$CURRENTDIR/spigot.jar"
echo "Exported Spigot to $CURRENTDIR/spigot.jar"
else
echo "Spigot build failed. Could not find Spigot .jar in $BUILDDIR."
fi
cd "$CURRENTDIR"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment