mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-12-28 04:19:41 -08:00
parent
3cca2104bb
commit
0a09924685
|
@ -53,11 +53,18 @@ func (env *environment) getTerminalWidth() (int, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (env *environment) getPlatform() string {
|
func (env *environment) getPlatform() string {
|
||||||
if wsl := env.getenv("WSL_DISTRO_NAME"); len(wsl) != 0 {
|
const key = "environment_platform"
|
||||||
return strings.ToLower(wsl)
|
if val, found := env.cache().get(key); found {
|
||||||
|
return val
|
||||||
}
|
}
|
||||||
p, _, _, _ := host.PlatformInformation()
|
var platform string
|
||||||
return p
|
defer env.cache().set(key, platform, -1)
|
||||||
|
if wsl := env.getenv("WSL_DISTRO_NAME"); len(wsl) != 0 {
|
||||||
|
platform = strings.ToLower(wsl)
|
||||||
|
return platform
|
||||||
|
}
|
||||||
|
platform, _, _, _ = host.PlatformInformation()
|
||||||
|
return platform
|
||||||
}
|
}
|
||||||
|
|
||||||
func (env *environment) getCachePath() string {
|
func (env *environment) getCachePath() string {
|
||||||
|
|
Loading…
Reference in a new issue