Skip to content

Commit

Permalink
fix: use correct home on git bash
Browse files Browse the repository at this point in the history
resolves #786
  • Loading branch information
JanDeDobbeleer committed Jun 8, 2021
1 parent d7258b1 commit 24f87f8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/environment_windows.go
Expand Up @@ -44,6 +44,10 @@ func (env *environment) isRunningAsRoot() bool {
}

func (env *environment) homeDir() string {
// return the right HOME reference when using MSYS2
if env.getShellName() == bash {
return os.Getenv("HOME")
}
home := os.Getenv("HOMEDRIVE") + os.Getenv("HOMEPATH")
if home == "" {
home = os.Getenv("USERPROFILE")
Expand Down

0 comments on commit 24f87f8

Please sign in to comment.