fix password listing; clean-up some cruft

password listing didn't include relative path
This commit is contained in:
Joel Beckmeyer 2021-11-30 15:23:59 -05:00
parent a84e155d89
commit 4bf9e85448

View File

@ -54,7 +54,7 @@ _pass_get() {
elif [ "$1" = "OTP" ]; then elif [ "$1" = "OTP" ]; then
pass otp "$password" | tail -n1 | { IFS= read -r pass; printf %s "$pass"; } pass otp "$password" | tail -n1 | { IFS= read -r pass; printf %s "$pass"; }
else else
printf '%s' "$(_pass_field "$@")" _pass_field "$@"
fi fi
} }
@ -84,8 +84,8 @@ if [ "$help" -eq 1 ]; then
exit 0 exit 0
fi fi
prefix=${PASSWORD_STORE_DIR-~/.password-store} cd "${PASSWORD_STORE_DIR:-$HOME/.password-store}"
password_files="$(find "$prefix" -name "*.gpg" -execdir basename {} .gpg ';')" password_files="$(find . -name "*.gpg" | sed "s/^\.\/\(.*\)\.gpg$/\1/")"
password=$(printf '%s\n' "$password_files" | wofi --dmenu) password=$(printf '%s\n' "$password_files" | wofi --dmenu)
[ -n "$password" ] || exit [ -n "$password" ] || exit