Abort properly on error for build script

This commit is contained in:
Aikar 2016-03-24 20:39:20 -04:00
parent 926ba9a3bb
commit 92f8da4b50
3 changed files with 22 additions and 7 deletions

View file

@ -40,11 +40,23 @@ function applyPatch {
pushd Spigot pushd Spigot
basedir=$basedir/Spigot basedir=$basedir/Spigot
# Apply Spigot # Apply Spigot
applyPatch ../Bukkit Spigot-API HEAD && applyPatch ../CraftBukkit Spigot-Server patched (
applyPatch ../Bukkit Spigot-API HEAD &&
applyPatch ../CraftBukkit Spigot-Server patched
) || (
echo "Failed to apply Spigot Patches"
exit 1
) || exit 1
# Move out of Spigot # Move out of Spigot
popd popd
basedir=$(dirname "$basedir") basedir=$(dirname "$basedir")
# Apply paper # Apply paper
applyPatch Spigot/Spigot-API Paper-API HEAD && applyPatch Spigot/Spigot-Server Paper-Server HEAD (
applyPatch Spigot/Spigot-API Paper-API HEAD &&
applyPatch Spigot/Spigot-Server Paper-Server HEAD
) || (
echo "Failed to apply Paper Patches"
exit 1
) || exit 1

View file

@ -1,6 +1,9 @@
#!/bin/bash #!/bin/bash
git submodule update --init && ./remap.sh && ./decompile.sh && ./init.sh && ./applyPatches.sh (git submodule update --init && ./remap.sh && ./decompile.sh && ./init.sh && ./applyPatches.sh) || (
echo "Failed to build Paper"
exit 1
) || exit 1
if [ "$1" == "--jar" ]; then if [ "$1" == "--jar" ]; then
mvn clean install && ./paperclip.sh (mvn clean install && ./paperclip.sh) || exit 1
fi fi

View file

@ -30,6 +30,6 @@ do
"$patch" -s -d src/main/java/ "net/minecraft/server/$file" < "$patchFile" "$patch" -s -d src/main/java/ "net/minecraft/server/$file" < "$patchFile"
done done
git add src >/dev/null 2>&1 git add src >/dev/null 2>&1 || exit 1
git commit -m "CraftBukkit $ $(date)" >/dev/null 2>&1 git commit -m "CraftBukkit $ $(date)" >/dev/null 2>&1 || exit 1
git checkout -f HEAD^ >/dev/null 2>&1 git checkout -f HEAD^ >/dev/null 2>&1 || exit 1