2016-04-02 03:55:54 +00:00
|
|
|
#!/usr/bin/env bash
|
2016-01-26 06:04:43 +00:00
|
|
|
|
2016-04-03 07:23:19 +00:00
|
|
|
(
|
|
|
|
set -e
|
2016-01-26 06:04:43 +00:00
|
|
|
PS1="$"
|
2016-04-03 08:35:51 +00:00
|
|
|
basedir="$(cd "$1" && pwd -P)"
|
2016-04-02 03:55:54 +00:00
|
|
|
workdir="$basedir/work"
|
2018-05-24 18:41:50 +00:00
|
|
|
gitcmd="git -c commit.gpgsign=false"
|
2016-01-26 06:04:43 +00:00
|
|
|
|
2019-04-03 03:20:10 +00:00
|
|
|
updated="0"
|
|
|
|
function getRef {
|
|
|
|
git ls-tree $1 $2 | cut -d' ' -f3 | cut -f1
|
|
|
|
}
|
2016-01-26 06:04:43 +00:00
|
|
|
function update {
|
2016-04-02 03:55:54 +00:00
|
|
|
cd "$workdir/$1"
|
2019-04-03 01:46:32 +00:00
|
|
|
$gitcmd fetch && $gitcmd clean -fd && $gitcmd reset --hard origin/master
|
2019-04-03 03:20:10 +00:00
|
|
|
refRemote=$(git rev-parse HEAD)
|
2016-01-26 06:04:43 +00:00
|
|
|
cd ../
|
2021-04-05 11:14:54 +00:00
|
|
|
$gitcmd add --force $1
|
2019-04-03 03:20:10 +00:00
|
|
|
refHEAD=$(getRef HEAD "$workdir/$1")
|
|
|
|
echo "$1 $refHEAD - $refRemote"
|
|
|
|
if [ "$refHEAD" != "$refRemote" ]; then
|
|
|
|
export updated="1"
|
|
|
|
fi
|
2016-01-26 06:04:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
update Bukkit
|
|
|
|
update CraftBukkit
|
2016-03-21 17:32:05 +00:00
|
|
|
update Spigot
|
2016-08-19 21:00:59 +00:00
|
|
|
|
2017-05-21 04:41:39 +00:00
|
|
|
if [[ "$2" = "all" || "$2" = "a" ]] ; then
|
2016-08-19 21:00:59 +00:00
|
|
|
update BuildData
|
|
|
|
fi
|
2019-04-03 03:20:10 +00:00
|
|
|
if [ "$updated" == "1" ]; then
|
|
|
|
echo "Rebuilding patches without filtering to improve apply ability"
|
|
|
|
cd "$basedir"
|
2021-06-15 06:42:57 +00:00
|
|
|
./gradlew applyPatches -Dpaperweight.debug=true || exit 1
|
|
|
|
./gradlew rebuildPatches || exit 1
|
2019-04-03 03:20:10 +00:00
|
|
|
fi
|
2016-04-03 07:23:19 +00:00
|
|
|
)
|