Update plugins/keychain/keychain.plugin.zsh

This commit is contained in:
Carlo Sala 2025-07-18 12:43:32 +02:00 committed by GitHub
commit e6d9adac14
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -21,12 +21,9 @@ function {
# Check keychain version to decide whether to use --agents
local version_string=$(keychain --version 2>&1 | head -n 2 | tail -n 1 | cut -d ' ' -f 4)
local -a version_parts=(${(s:.:)version_string})
local major=${version_parts[1]:-0}
local minor=${version_parts[2]:-0}
# start keychain, only use --agents for versions below 2.9.0
if (( major < 2 || (major == 2 && minor < 9) )); then
# start keychain, only use --agents for versions below 2.9.0
autoload -Uz is-at-least
if is-at-least 2.9 "$version_string"; then
keychain ${^options:-} --agents ${agents:-gpg} ${^identities} --host $SHORT_HOST
else
keychain ${^options:-} ${^identities} --host $SHORT_HOST