git_auto_update: Added and used error function

dehydrated
Felix Stupp 4 years ago
parent 15d80c8d43
commit f88b36fd1e
Signed by: zocker
GPG Key ID: 93E1BD26F6B02FB7

@ -9,6 +9,10 @@ readonly DEST_GROUP={{ group | quote }};
readonly PREFIX={{ tag_prefix | quote }};
readonly GPG_FINGERPRINT={{ gpg_fingerprint | quote }};
function error() {
echo "$@" >&2;
}
cd "$DEST";
if [ ! -d .git ]; then
@ -26,10 +30,10 @@ if [ -z "$GPG_FINGERPRINT" ] || (git verify-tag --raw "$TAG" 2>&1 | grep --fixed
git checkout --quiet --recurse-submodules "$TAG";
chown --recursive "$DEST_USER:$DEST_GROUP" .;
if ! sh -c {{ reload_command | default('true') | quote }}; then
echo "Reload command failed" >&2;
error "Reload command failed";
exit 2;
fi
else
echo "Invalid or missing signature for $TAG" >&2;
error "Invalid or missing signature for $TAG";
exit 1;
fi

Loading…
Cancel
Save