Handle gpg signing better (#1123)
Instead of checking whether it was set previously, setting it to false, then setting it back to true if it was true before, just use the command-line argument in git to override the config for that command. Using a variable makes it pretty painless to do.
This commit is contained in:
parent
3eb1cdef72
commit
d45565f83b
10 changed files with 87 additions and 102 deletions
|
@ -6,6 +6,7 @@ nms="net/minecraft/server"
|
|||
export MODLOG=""
|
||||
PS1="$"
|
||||
basedir="$(cd "$1" && pwd -P)"
|
||||
gitcmd="git -c commit.gpgsign=false"
|
||||
|
||||
workdir="$basedir/work"
|
||||
minecraftversion=$(cat "$workdir/BuildData/info.json" | grep minecraftVersion | cut -d '"' -f 4)
|
||||
|
@ -13,26 +14,26 @@ decompiledir="$workdir/Minecraft/$minecraftversion"
|
|||
|
||||
export importedmcdev=""
|
||||
function import {
|
||||
export importedmcdev="$importedmcdev $1"
|
||||
file="${1}.java"
|
||||
target="$workdir/Spigot/Spigot-Server/src/main/java/$nms/$file"
|
||||
base="$decompiledir/$nms/$file"
|
||||
export importedmcdev="$importedmcdev $1"
|
||||
file="${1}.java"
|
||||
target="$workdir/Spigot/Spigot-Server/src/main/java/$nms/$file"
|
||||
base="$decompiledir/$nms/$file"
|
||||
|
||||
if [[ ! -f "$target" ]]; then
|
||||
export MODLOG="$MODLOG Imported $file from mc-dev\n";
|
||||
echo "Copying $base to $target"
|
||||
cp "$base" "$target"
|
||||
else
|
||||
echo "UN-NEEDED IMPORT: $file"
|
||||
fi
|
||||
if [[ ! -f "$target" ]]; then
|
||||
export MODLOG="$MODLOG Imported $file from mc-dev\n";
|
||||
echo "Copying $base to $target"
|
||||
cp "$base" "$target"
|
||||
else
|
||||
echo "UN-NEEDED IMPORT: $file"
|
||||
fi
|
||||
}
|
||||
|
||||
(
|
||||
cd "$workdir/Spigot/Spigot-Server/"
|
||||
lastlog=$(git log -1 --oneline)
|
||||
if [[ "$lastlog" = *"mc-dev Imports"* ]]; then
|
||||
git reset --hard HEAD^
|
||||
fi
|
||||
cd "$workdir/Spigot/Spigot-Server/"
|
||||
lastlog=$($gitcmd log -1 --oneline)
|
||||
if [[ "$lastlog" = *"mc-dev Imports"* ]]; then
|
||||
$gitcmd reset --hard HEAD^
|
||||
fi
|
||||
)
|
||||
|
||||
import AxisAlignedBB
|
||||
|
@ -110,6 +111,6 @@ import WorldProvider
|
|||
|
||||
cd "$workdir/Spigot/Spigot-Server/"
|
||||
rm -rf nms-patches applyPatches.sh makePatches.sh >/dev/null 2>&1
|
||||
git add . -A >/dev/null 2>&1
|
||||
echo -e "mc-dev Imports\n\n$MODLOG" | git commit . -F -
|
||||
$gitcmd add . -A >/dev/null 2>&1
|
||||
echo -e "mc-dev Imports\n\n$MODLOG" | $gitcmd commit . -F -
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue