From 24f87f8557074d172e1b12835b009a340fecbe65 Mon Sep 17 00:00:00 2001 From: Jan De Dobbeleer Date: Mon, 7 Jun 2021 19:55:20 +0200 Subject: [PATCH] fix: use correct home on git bash resolves #786 --- src/environment_windows.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/environment_windows.go b/src/environment_windows.go index 12a53975..66c293d1 100644 --- a/src/environment_windows.go +++ b/src/environment_windows.go @@ -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")