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 {
|
func (env *environment) homeDir() string {
|
||||||
// return the right HOME reference when using MSYS2
|
home := os.Getenv("HOME")
|
||||||
if env.getShellName() == bash {
|
if len(home) > 0 {
|
||||||
return os.Getenv("HOME")
|
return home
|
||||||
}
|
}
|
||||||
home := os.Getenv("HOMEDRIVE") + os.Getenv("HOMEPATH")
|
// fallback to older implemenations on Windows
|
||||||
|
home = os.Getenv("HOMEDRIVE") + os.Getenv("HOMEPATH")
|
||||||
if home == "" {
|
if home == "" {
|
||||||
home = os.Getenv("USERPROFILE")
|
home = os.Getenv("USERPROFILE")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue