Skip to content

Commit

Permalink
node: require LocalAppData variable (ethereum#19132)
Browse files Browse the repository at this point in the history
* node: require LocalAppData variable

This avoids path inconsistencies on Windows XP.
Hat tip to @MicahZoltu for catching this so quickly.

* node: fix typo
  • Loading branch information
fjl authored and kiku-jw committed Mar 29, 2019
1 parent c5fcac8 commit 12b3eae
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions node/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,14 @@ func DefaultDataDir() string {
}

func windowsAppData() string {
if v := os.Getenv("LOCALAPPDATA"); v != "" {
return v // Vista+
v := os.Getenv("LOCALAPPDATA")
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 variable LocalAppData is undefined")
}
if v := os.Getenv("APPDATA"); v != "" {
return filepath.Join(v, "Local")
}
return ""
return v
}

func isNonEmptyDir(dir string) bool {
Expand Down

0 comments on commit 12b3eae

Please sign in to comment.