mirror of https://github.com/nirenjan/dotfiles.git
Wrap gpg snippet to ensure that the command is available
parent
9da5e26220
commit
a866ab7d4e
19
zsh/gpg.zsh
19
zsh/gpg.zsh
|
@ -1,10 +1,13 @@
|
||||||
gpgconf --launch gpg-agent
|
if command -v gpgconf >/dev/null
|
||||||
|
|
||||||
export SSH_AUTH_SOCK="$HOME/.gnupg/S.gpg-agent.ssh"
|
|
||||||
|
|
||||||
TSOCK=$(gpgconf --list-dirs agent-ssh-socket || true)
|
|
||||||
if [[ -n "$TSOCK" ]]
|
|
||||||
then
|
then
|
||||||
export SSH_AUTH_SOCK="$TSOCK"
|
gpgconf --launch gpg-agent
|
||||||
unset TSOCK
|
|
||||||
|
export SSH_AUTH_SOCK="$HOME/.gnupg/S.gpg-agent.ssh"
|
||||||
|
|
||||||
|
TSOCK=$(gpgconf --list-dirs agent-ssh-socket || true)
|
||||||
|
if [[ -n "$TSOCK" ]]
|
||||||
|
then
|
||||||
|
export SSH_AUTH_SOCK="$TSOCK"
|
||||||
|
unset TSOCK
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue