From b5f828c87e7074c6bb52ac243ac19b735419b5ac Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Fri, 18 Apr 2014 12:42:54 +0200 Subject: Remember to prune empty folders. --- src/password-store.sh | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') 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() { -- cgit v1.2.3