Skip to content

Commit

Permalink
use search instead of locate to look for entries
Browse files Browse the repository at this point in the history
  • Loading branch information
Angoll committed Mar 31, 2022
1 parent 2f2fc72 commit fb7a7dd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Binary file added KPass.v2.5.alfredworkflow
Binary file not shown.
13 changes: 9 additions & 4 deletions scripts/listDatabase.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ export PATH='/bin:/usr/local/bin/:/usr/bin:/Applications/KeePassXC.app/Contents/
function get_db_keys {
if [ ! -z "${keePassKeyFile}" ]; then
security find-generic-password -a $(id -un) -c 'kpas' -C 'kpas' -s "${keychainItem}" -w "${keychain}" |\
keepassxc-cli locate --key-file "${keePassKeyFile}" "${database}" / -q
keepassxc-cli search --key-file "${keePassKeyFile}" "${database}" - -q
else
security find-generic-password -a $(id -un) -c 'kpas' -C 'kpas' -s "${keychainItem}" -w "${keychain}" |\
keepassxc-cli locate "${database}" / -q
keepassxc-cli search "${database}" - -q
fi
}

Expand Down Expand Up @@ -34,8 +34,13 @@ function get_keys {

function get_errorInfo {
exec 3<&1
security find-generic-password -a $(id -un) -c 'kpas' -C 'kpas' -s "${keychainItem}" -w "${keychain}" 2>&3 |\
keepassxc-cli locate ${useKeePassKeyFile} '$database' / -q 2>&3
if [ ! -z "${keePassKeyFile}" ]; then
security find-generic-password -a $(id -un) -c 'kpas' -C 'kpas' -s "${keychainItem}" -w "${keychain}" 2>&3 |\
keepassxc-cli search --key-file "${keePassKeyFile}" "${database}" - -q 2>&3
else
security find-generic-password -a $(id -un) -c 'kpas' -C 'kpas' -s "${keychainItem}" -w "${keychain}" 2>&3 |\
keepassxc-cli search "${database}" - -q 2>&3
fi
exec 3>&-
}

Expand Down

0 comments on commit fb7a7dd

Please sign in to comment.