From: sev Date: Thu, 8 Oct 2020 14:48:52 +0000 (-0500) Subject: zshenv: ignore gpg on systems that don't have it X-Git-Url: https://git.sev.monster/~sev/dotfiles.git/commitdiff_plain/b0ce3f6d7d26276d18a953d29ec8f638a4bbb540?ds=inline zshenv: ignore gpg on systems that don't have it --- 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" ]] {