From a7a563f1b1bceb5672ea487da65f611cab5aa581 Mon Sep 17 00:00:00 2001 From: Alexandru Geana Date: Wed, 6 Apr 2022 22:38:31 +0200 Subject: [PATCH] replace APPDATA with LOCALAPPDATA Somewhere in GnuPG version 2.3.x, the location of the sockets on windows changed from %APPDATA%/gnupg to %LOCALAPPDATA%/gnupg. This commit fixes the paths where wsl-relay searches for the gpg-agent sockets. --- main.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 806884b..3d7d730 100644 --- a/main.go +++ b/main.go @@ -52,11 +52,11 @@ func main() { } else if *gpgFile != "" { fileName := *gpgFile if !filepath.IsAbs(fileName) { - appdata, ok := os.LookupEnv("APPDATA") + localAppData, ok := os.LookupEnv("LOCALAPPDATA") if !ok { - log.Fatal("Missing the %APPDATA% variable?") + log.Fatal("Missing the %LOCALAPPDATA% variable?") } - gpgDir := filepath.Join(appdata, "gnupg") + gpgDir := filepath.Join(localAppData, "gnupg") _, err := os.Stat(gpgDir) if os.IsNotExist(err) { log.Fatalf("The directory %q doesn't exist, please specify your full GPG path", gpgDir)