add wsl ssh agent setup

main
Andrew Coleman 2021-04-14 17:24:41 -04:00
parent 2a4417342c
commit 061cce7b7d
1 changed files with 11 additions and 0 deletions

View File

@ -0,0 +1,11 @@
{{- if (eq .chezmoi.os "linux") -}}
{{- if (contains "microsoft" .chezmoi.kernel.osrelease) -}}
if [ -z "$(pgrep ssh-agent)" ]; then
rm -rf /tmp/ssh-*
eval $(ssh-agent -s) > /dev/null
else
export SSH_AGENT_PID=$(pgrep ssh-agent)
export SSH_AUTH_SOCK=$(find /tmp/ssh-* -name agent.*)
fi
{{- end -}}
{{- end -}}