From 29f1b87f597c3b4256351230a22f4eb9710e541a Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Fri, 11 Aug 2023 17:08:08 -0400 Subject: [PATCH] Check if gpgconf exists before trying to run it --- .zshenv | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.zshenv b/.zshenv index f4785c2..9963fa0 100644 --- a/.zshenv +++ b/.zshenv @@ -39,6 +39,7 @@ fi # Set SSH auth socket unset SSH_AGENT_PID -if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then +if hash gpgconf 2>/dev/null && [[ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]] +then export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)" fi