fix: use correct home on git bash

resolves #786
This commit is contained in:
Jan De Dobbeleer 2021-06-07 19:55:20 +02:00 committed by Jan De Dobbeleer
parent d7258b1b5d
commit 24f87f8557

View file

@ -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")