From 840167afd66594d5a7bb49270df98023710413d0 Mon Sep 17 00:00:00 2001 From: "Cary M. Robbins" Date: Wed, 8 Oct 2014 07:27:03 +0200 Subject: [PATCH] Fixed ssh-agent plugin when ssh-add is not in /usr/bin/ssh-add --- plugins/ssh-agent/ssh-agent.plugin.zsh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/ssh-agent/ssh-agent.plugin.zsh b/plugins/ssh-agent/ssh-agent.plugin.zsh index 610ad34dc..f37286a8b 100644 --- a/plugins/ssh-agent/ssh-agent.plugin.zsh +++ b/plugins/ssh-agent/ssh-agent.plugin.zsh @@ -45,7 +45,13 @@ function _plugin__start_agent() zstyle -a :omz:plugins:ssh-agent identities identities echo starting ssh-agent... - /usr/bin/ssh-add $HOME/.ssh/${^identities} + if [ $(command -v ssh-add 2>/dev/null) ]; then + SSH_ADD=ssh-add + else + SSH_ADD=/usr/bin/ssh-add + fi + + $SSH_ADD $HOME/.ssh/${^identities} } # Get the filename to store/lookup the environment from