AutoYADM commit: 2024-11-10 00:57:31

This commit is contained in:
Daniel Fichtinger 2024-11-10 00:57:31 -05:00
parent 3ab9d12743
commit bddf87ead1

View file

@ -19,10 +19,10 @@ if [ -z "$HOST" ]; then
HOST="$(hostname)"
fi
yadm config advice.addIgnoredFile false
# First we read each path from "tracked"
(while read -r path; do
# we disable ignored warning for this subshell
yadm config advice.addIgnoredFile false
# Execute yadm add on each real file
# if the path points to a directory
# This ensures symlinks are not added
@ -34,6 +34,7 @@ fi
# If neither file nor dir, something is very wrong!
else
echo "$AYE Target must be a directory or a file!"
yadm config --unset advice.addIgnoredFile
exit 1
fi
done) <"$HOME/.config/yadm/tracked"
@ -46,6 +47,7 @@ if [[ -n $(yadm status --porcelain) ]]; then
if [[ -f "$sshenv" ]]; then
if ((!AUTOYADMPUSH)); then
echo "$AYM Pushing disabled, aborting..."
yadm config --unset advice.addIgnoredFile
exit 1
fi
# Directive to suppress shellcheck warning
@ -54,8 +56,10 @@ if [[ -n $(yadm status --porcelain) ]]; then
yadm push
else
echo "$AYE ssh-agent environment not found, aborting push..."
yadm config --unset advice.addIgnoredFile
exit 1
fi
fi
yadm config --unset advice.addIgnoredFile
echo "$AYM Push successful!"