[CI-SKIP] If mc-dev src folder exists, rebuild it on apply

This ensures your local copy of this folder is up to date whenever
mcdev imports change on the project.

Before, as we/upstream add/remove's imports, your local folder could
be out of sync and you have to randomly check 'do i need to run this?'

This will just automate it. For those people who don't use this
folder (not sure why you don't!), it won't change anything.
This commit is contained in:
Aikar 2018-08-11 13:42:15 -04:00
parent 88bca9bbfc
commit 2cb4cf8d52

View file

@ -4,6 +4,7 @@
PS1="$"
basedir="$(cd "$1" && pwd -P)"
workdir="$basedir/work"
minecraftversion=$(cat "$workdir/BuildData/info.json" | grep minecraftVersion | cut -d '"' -f 4)
gitcmd="git -c commit.gpgsign=false"
applycmd="$gitcmd am --3way --ignore-whitespace"
# Windows detection to workaround ARG_MAX limitation
@ -91,6 +92,11 @@ cd "$basedir"
(
applyPatch "work/Spigot/Spigot-API" Paper-API HEAD &&
applyPatch "work/Spigot/Spigot-Server" Paper-Server HEAD
# if we have previously ran ./paper mcdev, update it
if [ -d "$workdir/Minecraft/$minecraftversion/src" ]; then
$basedir/scripts/makemcdevsrc.sh $basedir
fi
) || (
echo "Failed to apply Paper Patches"
exit 1