summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xsrc/password-store.sh12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/password-store.sh b/src/password-store.sh
index 572ce2a..f80f026 100755
--- a/src/password-store.sh
+++ b/src/password-store.sh
@@ -114,12 +114,6 @@ reencrypt_path() {
prev_gpg_recipients="${GPG_RECIPIENTS[@]}"
done
}
-remove_empty_directories() {
- local old_dir="$1"
- while rmdir "$old_dir" &>/dev/null; do
- old_dir="${old_dir%/*}"
- done
-}
#
# END helper functions
@@ -281,7 +275,7 @@ cmd_init() {
git rm -qr "$gpg_id"
git_commit "Deinitialized ${gpg_id}."
fi
- remove_empty_directories "${gpg_id%/*}"
+ rmdir -p "${gpg_id%/*}" 2>/dev/null
exit 0
fi
@@ -545,7 +539,7 @@ cmd_delete() {
git rm -qr "$passfile"
git_commit "Removed $path from store."
fi
- remove_empty_directories "${passfile%/*}"
+ rmdir -p "${passfile%/*}" 2>/dev/null
}
cmd_copy_move() {
@@ -593,7 +587,7 @@ cmd_copy_move() {
git rm -qr "$old_path"
git_add_file "$new_path" "Renamed ${1} to ${2}."
fi
- remove_empty_directories "$old_dir"
+ rmdir -p "$old_dir" 2>/dev/null
else
cp $interactive -r -v "$old_path" "$new_path" || exit 1
[[ -e "$new_path" ]] && reencrypt_path "$new_path"
r> 2007-07-21updated howtonecoro1-14/+24 2007-07-20new Plugin Schemenecoro1-5/+4 2007-07-20new Plugin Schemenecoro1-1/+1 2007-07-20new Plugin Schemenecoro9-162/+214 2007-07-13fixesnecoro4-27/+37 2007-07-13new fancier log outputnecoro14-127/+116 2007-07-11added SIGSTOP/SIGCONT support; SIGTERM now works ;)necoro8-208/+275 2007-07-09bug in shutdown pluginnecoro2-5/+12 2007-07-09added resume_loop pluginnecoro1-1/+1 2007-07-09added resume_loop pluginnecoro10-22/+162 2007-07-07some more documentationnecoro6-4/+108 2007-07-07Some documentation worknecoro7-18/+129