diff options
-rwxr-xr-x | src/password-store.sh | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/password-store.sh b/src/password-store.sh index d4e9515..160250f 100755 --- a/src/password-store.sh +++ b/src/password-store.sh @@ -346,9 +346,10 @@ cmd_grep() { [ $? -ne 0 ] && continue passfile="${passfile%.gpg}" passfile="${passfile#$PREFIX/}" - local passfile_dir="${passfile%/*}" + local passfile_dir="${passfile%/*}/" + [[ $passfile_dir == "${passfile}/" ]] && passfile_dir="" passfile="${passfile##*/}" - printf "\e[94m%s/\e[1m%s\e[0m:\n" "$passfile_dir" "$passfile" + printf "\e[94m%s\e[1m%s\e[0m:\n" "$passfile_dir" "$passfile" echo "$grepresults" done < <(find -L "$PREFIX" -iname '*.gpg' -print0) } |