aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorHackyMiner <hackyminer@gmail.com>2019-02-19 19:15:15 +0800
committerFelix Lange <fjl@users.noreply.github.com>2019-02-19 19:15:15 +0800
commitf7f6a46029c23d2c1b5a5293d470becbdb4e3366 (patch)
treebfe3e6fa048e8bdc0d16357156909e079fc24413 /cmd
parentd2256244c4f6dbb7312fa280b5523c544d8c10af (diff)
downloadgo-tangerine-f7f6a46029c23d2c1b5a5293d470becbdb4e3366.tar
go-tangerine-f7f6a46029c23d2c1b5a5293d470becbdb4e3366.tar.gz
go-tangerine-f7f6a46029c23d2c1b5a5293d470becbdb4e3366.tar.bz2
go-tangerine-f7f6a46029c23d2c1b5a5293d470becbdb4e3366.tar.lz
go-tangerine-f7f6a46029c23d2c1b5a5293d470becbdb4e3366.tar.xz
go-tangerine-f7f6a46029c23d2c1b5a5293d470becbdb4e3366.tar.zst
go-tangerine-f7f6a46029c23d2c1b5a5293d470becbdb4e3366.zip
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
Diffstat (limited to 'cmd')
-rw-r--r--cmd/clef/main.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/cmd/clef/main.go b/cmd/clef/main.go
index 802e118e7..088701eee 100644
--- a/cmd/clef/main.go
+++ b/cmd/clef/main.go
@@ -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")
}