1
0
Fork 0
mirror of synced 2024-07-26 18:11:09 -04:00

Offer to add files.gpg if untracked

This commit is contained in:
Tim Byrne 2015-07-16 21:33:25 -05:00
parent d1fe16407d
commit 2ede46f5e4

12
yadm
View file

@ -240,6 +240,18 @@ function encrypt() {
error_out "Unable to write $YADM_ARCHIVE"
fi
#; offer to add YADM_ARCHIVE if untracked
archive_status=$(git status --porcelain -uall "$YADM_ARCHIVE" 2>/dev/null)
archive_regex="^\?\?"
if [[ $archive_status =~ $archive_regex ]] ; then
echo "It appears that $YADM_ARCHIVE is not tracked by yadm's repository."
echo "Would you like to add it now? (y/n)"
read answer
if [[ $answer =~ ^[yY]$ ]] ; then
git add "$YADM_ARCHIVE"
fi
fi
CHANGES_POSSIBLE=1
}