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