diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2014-04-18 12:42:54 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2014-04-18 12:42:54 +0200 |
commit | b5f828c87e7074c6bb52ac243ac19b735419b5ac (patch) | |
tree | 65431cdddde1a7cfa6298672856c6e38f2054fd3 /src | |
parent | 0f0483f789e4819b029cf2f9d8168a6172da4d92 (diff) |
Remember to prune empty folders.
Diffstat (limited to 'src')
-rwxr-xr-x | src/password-store.sh | 8 |
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() { |