mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
node: require LocalAppData variable
This avoids path inconsistencies on Windows XP. Hat tip to @MicahZoltu for catching this so quickly.
This commit is contained in:
parent
f1537b774c
commit
17d2ba5508
1 changed files with 7 additions and 6 deletions
|
|
@ -80,13 +80,14 @@ func DefaultDataDir() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func windowsAppData() string {
|
func windowsAppData() string {
|
||||||
if v := os.Getenv("LOCALAPPDATA"); v != "" {
|
v := os.Getenv("LOCALAPPDATA")
|
||||||
return v // Vista+
|
if v == "" {
|
||||||
|
// Windows XP and below don't have LocalAppData. Crash here because
|
||||||
|
// we don't support Windows XP and undefining the variable will cause
|
||||||
|
// other issues.
|
||||||
|
panic("environment varibale LocalAppData is undefined")
|
||||||
}
|
}
|
||||||
if v := os.Getenv("APPDATA"); v != "" {
|
return v
|
||||||
return filepath.Join(v, "Local")
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func isNonEmptyDir(dir string) bool {
|
func isNonEmptyDir(dir string) bool {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue