summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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() {