From 28a315775a8ea83c2239de27a59be866493f2c91 Mon Sep 17 00:00:00 2001 From: "Maxim (neiromaster) Gavrilenko" Date: Tue, 16 Apr 2024 14:12:07 +0300 Subject: [PATCH] Update ssh-agent setup for 1Password in zshrc 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. --- zsh/.zshrc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/zsh/.zshrc b/zsh/.zshrc index 42efac2..406a57a 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -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` @@ -968,4 +971,4 @@ function zqs() { if [[ -f ~/.zqs-zprof-enabled ]]; then zprof -fi \ No newline at end of file +fi