2013-01-15 01:18:40 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
basedir=$(dirname $(readlink -f $0))
|
|
|
|
echo "Rebuilding Forked projects.... "
|
|
|
|
|
|
|
|
function applyPatch {
|
|
|
|
what=$1
|
|
|
|
target=$2
|
|
|
|
cd $basedir
|
|
|
|
if [ ! -d "$basedir/$target" ]; then
|
|
|
|
git clone $1 $target
|
|
|
|
fi
|
|
|
|
cd "$basedir/$target"
|
|
|
|
echo "Resetting $target to $what..."
|
|
|
|
git remote rm upstream 2>/dev/null
|
|
|
|
git remote add upstream ../$what
|
|
|
|
git checkout master
|
|
|
|
git fetch upstream
|
|
|
|
git reset --hard upstream/master
|
|
|
|
echo " Applying patches to $target..."
|
|
|
|
git am --3way $basedir/${what}-Patches/*.patch
|
|
|
|
if [ "$?" != "0" ]; then
|
|
|
|
echo " Something did not apply cleanly to $target."
|
|
|
|
echo " Please review above details and finish the apply then"
|
|
|
|
echo " save the changes with rebuildPatches.sh"
|
2013-01-19 08:18:20 +00:00
|
|
|
exit 1
|
2013-01-15 01:18:40 +00:00
|
|
|
else
|
|
|
|
echo " Patches applied cleanly to $target"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2013-01-19 08:18:20 +00:00
|
|
|
applyPatch Bukkit Spigot-API && applyPatch CraftBukkit Spigot
|