mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-03-05 20:49:04 -08:00
fix(windows): try HOME by default for user home
This commit is contained in:
parent
9576e8212e
commit
2aa00da41b
|
@ -44,11 +44,12 @@ 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("HOME")
|
||||
if len(home) > 0 {
|
||||
return home
|
||||
}
|
||||
home := os.Getenv("HOMEDRIVE") + os.Getenv("HOMEPATH")
|
||||
// fallback to older implemenations on Windows
|
||||
home = os.Getenv("HOMEDRIVE") + os.Getenv("HOMEPATH")
|
||||
if home == "" {
|
||||
home = os.Getenv("USERPROFILE")
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue