Offer to add files.gpg
if untracked
This commit is contained in:
parent
d1fe16407d
commit
2ede46f5e4
1 changed files with 12 additions and 0 deletions
12
yadm
12
yadm
|
@ -240,6 +240,18 @@ function encrypt() {
|
||||||
error_out "Unable to write $YADM_ARCHIVE"
|
error_out "Unable to write $YADM_ARCHIVE"
|
||||||
fi
|
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
|
CHANGES_POSSIBLE=1
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue