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/1d55565f854a413ea2d7c3ea09c5defcfa3f4b5c?ds=sidebyside 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" ]] {