From d817e80741c39cd621aadc56db29d0d23c5b3fe8 Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Thu, 8 Aug 2013 20:26:34 -0400 Subject: [PATCH] [Fix #452] Squash bugs introduced in fcab2a1 --- modules/ssh/init.zsh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/modules/ssh/init.zsh b/modules/ssh/init.zsh index 447846f..320f763 100644 --- a/modules/ssh/init.zsh +++ b/modules/ssh/init.zsh @@ -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}