password-store

Simple password manager using gpg and ordinary unix directories
git clone https://git.zx2c4.com/password-store
Log | Files | Refs | README | LICENSE

commit 0d9c02562ea5792fdf9691135a2b48f667a4c97d
parent 7797980519ad8938e8290503ce721ef5f194c01f
Author: Brian Mattern <rephorm@rephorm.com>
Date:   Mon, 20 May 2013 09:44:33 -0700

check if a passfile exists before checking for directory

Diffstat:
Msrc/password-store.sh | 25++++++++++++-------------
1 file changed, 12 insertions(+), 13 deletions(-)

diff --git a/src/password-store.sh b/src/password-store.sh @@ -207,19 +207,8 @@ case "$command" in fi path="$1" - if [[ -d $PREFIX/$path ]]; then - if [[ -z $path ]]; then - echo "Password Store" - else - echo "${path%\/}" - fi - tree -l --noreport "$PREFIX/$path" | tail -n +2 | sed 's/\.gpg$//' - else - passfile="$PREFIX/$path.gpg" - if [[ ! -f $passfile ]]; then - echo "$path is not in the password store." - exit 1 - fi + passfile="$PREFIX/$path.gpg" + if [[ -f $passfile ]]; then if [[ $clip -eq 0 ]]; then exec gpg2 -d $GPG_OPTS "$passfile" else @@ -227,6 +216,16 @@ case "$command" in [[ -n $pass ]] || exit 1 clip "$pass" "$path" fi + elif [[ -d $PREFIX/$path ]]; then + if [[ -z $path ]]; then + echo "Password Store" + else + echo "${path%\/}" + fi + tree -l --noreport "$PREFIX/$path" | tail -n +2 | sed 's/\.gpg$//' + else + echo "$path is not in the password store." + exit 1 fi ;; insert)