Skip to content

Commit

Permalink
[Fix sorin-ionescu#452] Squash bugs introduced in fcab2a1
Browse files Browse the repository at this point in the history
  • Loading branch information
RIT80 authored and RIT80 committed Aug 9, 2013
1 parent 927c950 commit b0cf6f4
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions modules/ssh/init.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -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}

0 comments on commit b0cf6f4

Please sign in to comment.