1
0
mirror of https://github.com/TheLocehiliosan/yadm synced 2026-03-02 03:49:29 +00:00

Only assert private dirs, when worktree = $HOME (#171)

This commit is contained in:
Tim Byrne
2019-12-13 07:34:06 -06:00
parent cc1993dc14
commit 84a173551e
2 changed files with 12 additions and 9 deletions

17
yadm
View File

@@ -1107,14 +1107,17 @@ function perms() {
# include the archive created by "encrypt"
[ -f "$YADM_ARCHIVE" ] && GLOBS+=("$YADM_ARCHIVE")
# include all .ssh files (unless disabled)
if [[ $(config --bool yadm.ssh-perms) != "false" ]] ; then
GLOBS+=(".ssh" ".ssh/*" ".ssh/.[!.]*")
fi
# only include private globs if using HOME as worktree
if [ "$YADM_WORK" = "$HOME" ]; then
# include all .ssh files (unless disabled)
if [[ $(config --bool yadm.ssh-perms) != "false" ]] ; then
GLOBS+=(".ssh" ".ssh/*" ".ssh/.[!.]*")
fi
# include all gpg files (unless disabled)
if [[ $(config --bool yadm.gpg-perms) != "false" ]] ; then
GLOBS+=(".gnupg" ".gnupg/*" ".gnupg/.[!.]*")
# include all gpg files (unless disabled)
if [[ $(config --bool yadm.gpg-perms) != "false" ]] ; then
GLOBS+=(".gnupg" ".gnupg/*" ".gnupg/.[!.]*")
fi
fi
# include any files we encrypt