From b0ce3f6d7d26276d18a953d29ec8f638a4bbb540 Mon Sep 17 00:00:00 2001 From: sev Date: Thu, 8 Oct 2020 09:48:52 -0500 Subject: [PATCH] zshenv: ignore gpg on systems that don't have it --- base/.zshenv | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/base/.zshenv b/base/.zshenv index 46b0e66..8383afb 100644 --- a/base/.zshenv +++ b/base/.zshenv @@ -24,12 +24,14 @@ export PYTHONSTARTUP=~/.pythonrc ## perl (( ${+commands[perl]} )) && eval $(perl -I $XDG_DATA_HOME/perl5/lib/perl5 -Mlocal::lib=$XDG_DATA_HOME/perl5) ## gpg -export GPG_TTY=$(tty) -if [[ ! -v SSH_AUTH_SOCK ]] { - # set up SSH auth socket and start GPG agent - export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) +if (( ${+commands[gpg]} )); { + export GPG_TTY=$(tty) + if [[ ! -v SSH_AUTH_SOCK ]] { + # set up SSH auth socket and start GPG agent + export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) + } + gpg-connect-agent updatestartuptty /bye >/dev/null } -gpg-connect-agent updatestartuptty /bye >/dev/null ### freebsd if [[ "$OSTYPE" =~ "^freebsd" ]] { -- 2.47.0