From ba4c7e9e8b405029255c071792f8eeeb890c327a Mon Sep 17 00:00:00 2001 From: Aikar Date: Thu, 24 Mar 2016 20:39:20 -0400 Subject: [PATCH] Abort properly on error for build script --- applyPatches.sh | 16 ++++++++++++++-- build.sh | 7 +++++-- init.sh | 6 +++--- 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/applyPatches.sh b/applyPatches.sh index be46ee21b1..029aad9ee6 100755 --- a/applyPatches.sh +++ b/applyPatches.sh @@ -40,11 +40,23 @@ function applyPatch { pushd Spigot basedir=$basedir/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 popd basedir=$(dirname "$basedir") # 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 diff --git a/build.sh b/build.sh index 3b5cc2e147..00eb9131e1 100755 --- a/build.sh +++ b/build.sh @@ -1,6 +1,9 @@ #!/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 - mvn clean install && ./paperclip.sh + (mvn clean install && ./paperclip.sh) || exit 1 fi diff --git a/init.sh b/init.sh index ee291e15ff..1def2965d2 100755 --- a/init.sh +++ b/init.sh @@ -30,6 +30,6 @@ do "$patch" -s -d src/main/java/ "net/minecraft/server/$file" < "$patchFile" done -git add src >/dev/null 2>&1 -git commit -m "CraftBukkit $ $(date)" >/dev/null 2>&1 -git checkout -f HEAD^ >/dev/null 2>&1 +git add src >/dev/null 2>&1 || exit 1 +git commit -m "CraftBukkit $ $(date)" >/dev/null 2>&1 || exit 1 +git checkout -f HEAD^ >/dev/null 2>&1 || exit 1