Better checking of env var & better logging

This commit is contained in:
Daniel Fichtinger 2024-11-11 21:03:21 -05:00
parent 31bfbde0c8
commit d459b57cec

View file

@ -11,8 +11,9 @@ AYM="AutoYADM:"
AUTOYADMDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" AUTOYADMDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# We check not to overwrite the user's env setting # We check not to overwrite the user's env setting
if [ -z "$AUTOYADMPUSH" ]; then if [ -z "$AUTOYADMPUSH" ] || ((!AUTOYADMPUSH)); then
AUTOYADMPUSH=0 AUTOYADMPUSH=0
echo "$AYM Autopush is disabled."
fi fi
# Set hostname explicitly because it # Set hostname explicitly because it
@ -58,4 +59,6 @@ if [[ -n $(yadm status --porcelain) ]]; then
echo "$AYE ssh-agent environment not found, aborting push..." echo "$AYE ssh-agent environment not found, aborting push..."
exit 1 exit 1
fi fi
else
echo "$AYM Nothing to commit."
fi fi