Skip to content

Commit

Permalink
macos_keychain: Remove unnecessary password prompt for fzf preview
Browse files Browse the repository at this point in the history
  • Loading branch information
sschmid committed Oct 19, 2024
1 parent 0fac528 commit 3f6926a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/plugins/macos_keychain/fzf_preview
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ options="$1" keychain_password="$2" keychain="$3"
# KCOV_EXCL_START
# shellcheck disable=SC1083
_fzf_preview() {
security find-generic-password -l {4} -a {5} -s {6} -g "${keychain}" 2>/dev/null \
security find-generic-password -l {4} -a {5} -s {6} "${keychain}" \
| "${_parse_details}" 'printf "Name: %s\nAccount: %s\nWhere: %s\nComments:\n%s\n", label, account, service, comments'
}
# KCOV_EXCL_STOP
Expand Down
3 changes: 2 additions & 1 deletion test/macos_keychain.bats
Original file line number Diff line number Diff line change
Expand Up @@ -497,9 +497,10 @@ EOF
# fzf preview
################################################################################

@test "shows fzf preview for single line notes" {
@test "shows fzf preview for single line notes even when locked" {
assert_adds_item "${PW_1}" "${NAME_A}" "${ACCOUNT_A}" "${URL_A}" "${SINGLE_LINE_NOTES}"
assert_item_exists "${PW_1}" "${NAME_A}"
pw lock

local cmd
cmd="$("${PROJECT_ROOT}/src/plugins/macos_keychain/fzf_preview" "" "" "${PW_KEYCHAIN}")"
Expand Down

0 comments on commit 3f6926a

Please sign in to comment.