mirror of
https://github.com/robbyrussell/oh-my-zsh.git
synced 2025-12-06 07:20:40 +01:00
feat(keychain): support >2.9 (#13189)
Co-authored-by: Carlo Sala <carlosalag@protonmail.com>
This commit is contained in:
@@ -19,8 +19,15 @@ function {
|
|||||||
# load additional options
|
# load additional options
|
||||||
zstyle -a :omz:plugins:keychain options options
|
zstyle -a :omz:plugins:keychain options options
|
||||||
|
|
||||||
# start keychain...
|
# Check keychain version to decide whether to use --agents
|
||||||
keychain ${^options:-} --agents ${agents:-gpg} ${^identities} --host $SHORT_HOST
|
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
|
# Get the filenames to store/lookup the environment from
|
||||||
_keychain_env_sh="$HOME/.keychain/$SHORT_HOST-sh"
|
_keychain_env_sh="$HOME/.keychain/$SHORT_HOST-sh"
|
||||||
|
|||||||
Reference in New Issue
Block a user