summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2014-04-18 12:42:54 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2014-04-18 12:42:54 +0200
commitb5f828c87e7074c6bb52ac243ac19b735419b5ac (patch)
tree65431cdddde1a7cfa6298672856c6e38f2054fd3 /src
parent0f0483f789e4819b029cf2f9d8168a6172da4d92 (diff)
downloadpass-b5f828c87e7074c6bb52ac243ac19b735419b5ac.tar.gz
pass-b5f828c87e7074c6bb52ac243ac19b735419b5ac.tar.bz2
pass-b5f828c87e7074c6bb52ac243ac19b735419b5ac.zip
Remember to prune empty folders.
Diffstat (limited to '')
-rwxr-xr-xsrc/password-store.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/password-store.sh b/src/password-store.sh
index fe21e19..a3fd640 100755
--- a/src/password-store.sh
+++ b/src/password-store.sh
@@ -275,6 +275,10 @@ cmd_init() {
git rm -qr "$gpg_id"
git_commit "Deinitialized ${gpg_id}."
fi
+ gpg_id="${gpg_id%/*}"
+ while rmdir "$gpg_id" &>/dev/null; do
+ gpg_id="${gpg_id%/*}"
+ done
exit 0
fi
@@ -538,6 +542,10 @@ cmd_delete() {
git rm -qr "$passfile"
git_commit "Removed $path from store."
fi
+ passfile="${passfile%/*}"
+ while rmdir "$passfile" &>/dev/null; do
+ passfile="${passfile%/*}"
+ done
}
cmd_copy_move() {