c96fc233c4903ba75fba5bc55e7f91f9dc8e460e
- Author
- Wayne Lloyd <waynelloyd@outlook.com>
- Committer
- GitHub <noreply@github.com>
- Date
Message
fix(gpg-agent): suppress errors from `gpgconf` (#10769)
Diff
1diff --git a/plugins/gpg-agent/gpg-agent.plugin.zsh b/plugins/gpg-agent/gpg-agent.plugin.zsh
2index 0adc8de5dba08cb654c0e950ae650121875dba1e..1f4be20b04ec3615fbc7f4880bef5c2f92c49ef9 100644
3--- a/plugins/gpg-agent/gpg-agent.plugin.zsh
4+++ b/plugins/gpg-agent/gpg-agent.plugin.zsh
5@@ -9,7 +9,7 @@ autoload -U add-zsh-hook
6 add-zsh-hook preexec _gpg-agent_update-tty_preexec
7
8 # If enable-ssh-support is set, fix ssh agent integration
9-if [[ $(gpgconf --list-options gpg-agent | awk -F: '$1=="enable-ssh-support" {print $10}') = 1 ]]; then
10+if [[ $(gpgconf --list-options gpg-agent 2>/dev/null | awk -F: '$1=="enable-ssh-support" {print $10}') = 1 ]]; then
11 unset SSH_AGENT_PID
12 if [[ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]]; then
13 export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"