From a9bec11e31dd18b78ec0e536e956ccf24c16bd4d Mon Sep 17 00:00:00 2001 From: George Rawlinson Date: Thu, 8 Jul 2021 14:33:48 +0000 Subject: [PATCH] fix: only export GPG_TTY if gpg is installed --- source/gpg.zsh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/gpg.zsh b/source/gpg.zsh index 8c1a33d..fcefeb5 100644 --- a/source/gpg.zsh +++ b/source/gpg.zsh @@ -9,7 +9,9 @@ # It is important that this environment variable always reflects the out‐ # put of the tty command. -GPG_TTY=$(tty) -export GPG_TTY +if command -v gpg-agent &> /dev/null; then + GPG_TTY=$(tty) + export GPG_TTY +fi # vim: ft=zsh expandtab tabstop=2 shiftwidth=2