1
0
mirror of https://github.com/dcarrillo/prezto.git synced 2024-12-22 11:38:00 +00:00

[Fix #452] Squash bugs introduced in fcab2a1

This commit is contained in:
Sorin Ionescu 2013-08-08 20:26:34 -04:00
parent 9d504d2d93
commit d817e80741

View File

@ -27,22 +27,22 @@ else
source "$_ssh_agent_env" 2> /dev/null
fi
# Load identities.
if ssh-add -l 2>&1 | grep 'The agent has no identities'; then
zstyle -a ':prezto:module:ssh:load' identities '_ssh_identities'
if (( ${#identities} > 0 )); then
ssh-add "$_ssh_dir/${^_ssh_identities[@]}"
else
ssh-add
fi
fi
# Create a persistent SSH authentication socket.
if [[ -S "$SSH_AUTH_SOCK" && "$SSH_AUTH_SOCK" != "$_ssh_agent_sock" ]]; then
ln -sf "$SSH_AUTH_SOCK" "$_ssh_agent_sock"
export SSH_AUTH_SOCK="$_ssh_agent_sock"
fi
# Load identities.
if ssh-add -l 2>&1 | grep -q 'The agent has no identities'; then
zstyle -a ':prezto:module:ssh:load' identities '_ssh_identities'
if (( ${#_ssh_identities} > 0 )); then
ssh-add "$_ssh_dir/${^_ssh_identities[@]}" 2> /dev/null
else
ssh-add 2> /dev/null
fi
fi
# Clean up.
unset _ssh_{dir,identities} _ssh_agent_{env,sock}