feat(keychain): support >2.9 (#13189)

Co-authored-by: Carlo Sala <carlosalag@protonmail.com>
master
Zachary Craig 11 months ago committed by GitHub
parent 3e7ef0182f
commit df200c943a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 9
      plugins/keychain/keychain.plugin.zsh

@ -19,8 +19,15 @@ function {
# load additional options
zstyle -a :omz:plugins:keychain options options
# start keychain...
# 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)
# 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
fi
# Get the filenames to store/lookup the environment from
_keychain_env_sh="$HOME/.keychain/$SHORT_HOST-sh"

Loading…
Cancel
Save