mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 18:32:23 +00:00
cmd, node: use APPDATA env if it available
This commit is contained in:
parent
6b9f68f060
commit
c5549ae256
2 changed files with 12 additions and 2 deletions
|
|
@ -494,7 +494,12 @@ func DefaultConfigDir() string {
|
||||||
if runtime.GOOS == "darwin" {
|
if runtime.GOOS == "darwin" {
|
||||||
return filepath.Join(home, "Library", "Signer")
|
return filepath.Join(home, "Library", "Signer")
|
||||||
} else if runtime.GOOS == "windows" {
|
} else if runtime.GOOS == "windows" {
|
||||||
|
appdata := os.Getenv("APPDATA")
|
||||||
|
if appdata != "" {
|
||||||
|
return filepath.Join(appdata, "Signer")
|
||||||
|
} else {
|
||||||
return filepath.Join(home, "AppData", "Roaming", "Signer")
|
return filepath.Join(home, "AppData", "Roaming", "Signer")
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return filepath.Join(home, ".clef")
|
return filepath.Join(home, ".clef")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,12 @@ func DefaultDataDir() string {
|
||||||
if runtime.GOOS == "darwin" {
|
if runtime.GOOS == "darwin" {
|
||||||
return filepath.Join(home, "Library", "Ethereum")
|
return filepath.Join(home, "Library", "Ethereum")
|
||||||
} else if runtime.GOOS == "windows" {
|
} else if runtime.GOOS == "windows" {
|
||||||
return filepath.Join(os.Getenv("APPDATA"), "Ethereum")
|
appdata := os.Getenv("APPDATA")
|
||||||
|
if appdata != "" {
|
||||||
|
return filepath.Join(appdata, "Ethereum")
|
||||||
|
} else {
|
||||||
|
return filepath.Join(home, "AppData", "Roaming", "Ethereum")
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return filepath.Join(home, ".ethereum")
|
return filepath.Join(home, ".ethereum")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue