general: Don't leave empty dirs behind.

This commit is contained in:
Dylan Araps 2019-05-22 22:05:43 +03:00
parent 4172592ae1
commit e16fffe56e
1 changed files with 3 additions and 1 deletions

4
pash
View File

@ -23,8 +23,10 @@ pw_add() {
pw_del() { pw_del() {
yn "Delete pass file '$1'?" yn "Delete pass file '$1'?"
[[ $REPLY == [yY] ]] && [[ $REPLY == [yY] ]] && {
rm "$1.gpg" rm "$1.gpg"
rmdir -p "${1%/*}" 2>/dev/null
}
} }
pw_show() { pw_show() {