Created
September 9, 2014 23:40
-
-
Save jaqque/82efab552f2e25daf1e8 to your computer and use it in GitHub Desktop.
Helper script for patching SpigotMC
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
cd `dirname $0` | |
patcher='SpigotPatcher-1.0.jar' | |
source='spigot-1649.jar' | |
md5='f2edc09c45b1f80237602dc0d1b05969' | |
suffix='.bps'; # not actually used. | |
patch="$1" | |
target="${patch%.bps}.jar" | |
[ -f "$patcher" ] || { | |
echo 'Download the Spigot patcher' | |
echo 'http://www.spigotmc.org/spigot-updates/SpigotPatcher-1.0.jar' | |
exit 1 | |
} | |
[ -f "$source" ] || { | |
echo 'Aquire the last Spigot release (#1649). I can'"'"'t help you any further.' | |
exit 2 | |
} | |
echo "$md5 $source" | md5sum --check --quiet || exit 1 | |
[ "$patch" ] || { | |
echo "Must supply binary patch (spigot.bps)" | |
exit 1 | |
} | |
[ -f "$patch" ] || { | |
echo "No such file: $patch" | |
exit 1 | |
} | |
[ "$patch" = "${patch%.bps}.bps" ] || { | |
echo "Are you sure $patch is a binary patch? (.bps)" | |
exit 1 | |
} | |
[ ! -f "$target" ] || { | |
echo "Already built: $target ($(cat $target|md5sum|awk '{print $1}'))" | |
exit 0 | |
} | |
java -jar "$patcher" "$source" $1 ${1%.bps}.jar |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Put this in the same directory as SpigotPatcher-1.0.jar, spigot-1649.jar, and the spigot.bps.
Prerequisites: java installed, md5sum available.