9
0
mirror of https://github.com/LeavesMC/Leaves.git synced 2025-12-19 14:59:32 +00:00
Files
LeavesMC/scripts/upstreamCommit.sh
violetc 014a532af5 init
2021-10-30 19:42:38 +08:00

28 lines
643 B
Bash

#!/usr/bin/env bash
(
set -e
PS1="$"
function changelog() {
base=$(git ls-tree HEAD $1 | cut -d' ' -f3 | cut -f1)
cd $1 && git log --oneline ${base}...HEAD
}
paper=$(changelog Paper)
updated=""
logsuffix=""
if [ ! -z "$paper" ]; then
logsuffix="$logsuffix\n\nPaper Changes:\n$paper"
if [ -z "$updated" ]; then updated="Paper"; else updated="$updated/Paper"; fi
fi
disclaimer="Upstream has released updates that appears to apply and compile correctly"
if [ ! -z "$1" ]; then
disclaimer="$@"
fi
log="${UP_LOG_PREFIX}Updated Upstream ($updated)\n\n${disclaimer}${logsuffix}"
echo -e "$log" | git commit -F -
) || exit 1