From 782c8652366c173626c2f1ddd40eb1b220bd97d6 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 22 Mar 2023 18:04:21 +0100 Subject: tv fzmenu: admit symlinks --- tv/5pkgs/simple/fzmenu/bin/otpmenu | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'tv/5pkgs/simple/fzmenu/bin/otpmenu') diff --git a/tv/5pkgs/simple/fzmenu/bin/otpmenu b/tv/5pkgs/simple/fzmenu/bin/otpmenu index 12bd60a9d..273a408e6 100755 --- a/tv/5pkgs/simple/fzmenu/bin/otpmenu +++ b/tv/5pkgs/simple/fzmenu/bin/otpmenu @@ -10,14 +10,17 @@ case ${FZMENU_PHASE-0} in ;; 1) if result=$( + PASSWORD_STORE_DIR=${PASSWORD_STORE_DIR-$HOME/.password-store} FZF_DEFAULT_OPTS=${FZMENU_FZF_DEFAULT_OPTS-} if test -n "$FZF_DEFAULT_OPTS"; then export FZF_DEFAULT_OPTS fi - pass git ls-files '*/otp.gpg' | \ - sed ' - - s/\/otp\.gpg$// + find -L "$PASSWORD_STORE_DIR" -type f -name 'otp.gpg' | + awk -F / -v PASSWORD_STORE_DIR="$PASSWORD_STORE_DIR" ' + { n = length(PASSWORD_STORE_DIR "/") } + $NF == "otp.gpg" { + print substr($0, 1 + n, length($0)-length("/otp.gpg")-n) + } ' | exec fzf \ --history=/dev/null \ -- cgit v1.2.3