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
This commit is contained in:
HackyMiner
2019-02-19 20:15:15 +09:00
committed by Felix Lange
parent d2256244c4
commit f7f6a46029
3 changed files with 48 additions and 7 deletions

View File

@ -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")
}