Skip to content

Commit

Permalink
Update ssh-agent setup for 1Password in zshrc
Browse files Browse the repository at this point in the history
The function load-our-ssh-keys in zshrc has been updated to check for the existence of 1Password before setting up the ssh-agent. Now, the ssh-agent will only be initialized for 1Password if it's installed on the system. This change effectively prevents potential errors when 1Password is not available.

Signed-off-by: Maxim (neiromaster) Gavrilenko <[email protected]>
  • Loading branch information
neiromaster committed Apr 16, 2024
1 parent 49f6f48 commit deeae41
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions zsh/.zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,10 @@ onepassword-agent-check() {
}

load-our-ssh-keys() {
onepassword-agent-check
# setup ssh-agent for 1password only if it's installed
if can_haz op; then
onepassword-agent-check
fi
# If keychain is installed let it take care of ssh-agent, else do it manually
if can_haz keychain; then
eval `keychain -q --eval`
Expand Down Expand Up @@ -968,4 +971,4 @@ function zqs() {

if [[ -f ~/.zqs-zprof-enabled ]]; then
zprof
fi
fi

0 comments on commit deeae41

Please sign in to comment.