Skip to content

Commit 23b8d10

Browse files
committed
Fix home dir for windows
Apparently the home path might very well be on a network drive, like H:\ which is a pain if the user disconnects. Default to the user profile first, then only fall back to home if that's missing.
1 parent e5a6ce8 commit 23b8d10

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎config/config.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ type Config struct {
5555
func Home() (string, error) {
5656
var dir string
5757
if runtime.GOOS == "windows" {
58-
dir = os.Getenv("HOMEDRIVE") + os.Getenv("HOMEPATH")
58+
dir = os.Getenv("USERPROFILE")
5959
if dir == "" {
60-
dir = os.Getenv("USERPROFILE")
60+
dir = os.Getenv("HOMEDRIVE") + os.Getenv("HOMEPATH")
6161
}
6262
} else {
6363
dir = os.Getenv("HOME")

0 commit comments

Comments
 (0)