Update byof scripts

This commit is contained in:
William Blake Galbreath
2020-07-02 20:35:42 -05:00
parent 7a778f7212
commit 140a58f451
9 changed files with 271 additions and 266 deletions

View File

@@ -1,28 +1,28 @@
#!/usr/bin/env bash
(
set -e
PS1="$"
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)
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 [ -n "$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"
updated=""
logsuffix=""
if [ -n "$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 [ -n "$1" ]; then
disclaimer=( "$@" )
fi
if [ -n "$1" ]; then
disclaimer=("$@")
fi
log="${UP_LOG_PREFIX}Updated Upstream ($updated)\n\n${disclaimer[*]}${logsuffix}"
log="${UP_LOG_PREFIX}Updated Upstream ($updated)\n\n${disclaimer[*]}${logsuffix}"
echo -e "$log" | git commit -F -
echo -e "$log" | git commit -F -
) || exit 1