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:
@ -68,8 +68,15 @@ func init() {
|
||||
home = user.HomeDir
|
||||
}
|
||||
}
|
||||
if runtime.GOOS == "windows" {
|
||||
DefaultConfig.Ethash.DatasetDir = filepath.Join(home, "AppData", "Ethash")
|
||||
if runtime.GOOS == "darwin" {
|
||||
DefaultConfig.Ethash.DatasetDir = filepath.Join(home, "Library", "Ethash")
|
||||
} else if runtime.GOOS == "windows" {
|
||||
localappdata := os.Getenv("LOCALAPPDATA")
|
||||
if localappdata != "" {
|
||||
DefaultConfig.Ethash.DatasetDir = filepath.Join(localappdata, "Ethash")
|
||||
} else {
|
||||
DefaultConfig.Ethash.DatasetDir = filepath.Join(home, "AppData", "Local", "Ethash")
|
||||
}
|
||||
} else {
|
||||
DefaultConfig.Ethash.DatasetDir = filepath.Join(home, ".ethash")
|
||||
}
|
||||
|
Reference in New Issue
Block a user