From f7f6a46029c23d2c1b5a5293d470becbdb4e3366 Mon Sep 17 00:00:00 2001 From: HackyMiner Date: Tue, 19 Feb 2019 20:15:15 +0900 Subject: eth, node: use APPDATA env to support cygwin/msys correctly (#17786) This changes default location of the data directory to use the LOCALAPPDATA environment variable, resolving issues with remote home directories an improving compatibility with Cygwin. Fixes #2239 Fixes #2237 Fixes #16437 --- cmd/clef/main.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'cmd') diff --git a/cmd/clef/main.go b/cmd/clef/main.go index 802e118e7..088701eee 100644 --- a/cmd/clef/main.go +++ b/cmd/clef/main.go @@ -533,7 +533,12 @@ func DefaultConfigDir() string { if runtime.GOOS == "darwin" { return filepath.Join(home, "Library", "Signer") } else if runtime.GOOS == "windows" { - return filepath.Join(home, "AppData", "Roaming", "Signer") + appdata := os.Getenv("APPDATA") + if appdata != "" { + return filepath.Join(appdata, "Signer") + } else { + return filepath.Join(home, "AppData", "Roaming", "Signer") + } } else { return filepath.Join(home, ".clef") } -- cgit v1.2.3