mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-01-30 04:21:19 -08:00
fix(env): remove defer on platform
This is a small fix to actually store the value. Arguments to defers are apparently evaluated immediately so put it in an anonymous function.
This commit is contained in:
parent
ad297dbe08
commit
de60367d79
|
@ -58,7 +58,9 @@ func (env *environment) getPlatform() string {
|
||||||
return val
|
return val
|
||||||
}
|
}
|
||||||
var platform string
|
var platform string
|
||||||
defer env.cache().set(key, platform, -1)
|
defer func() {
|
||||||
|
env.cache().set(key, platform, -1)
|
||||||
|
}()
|
||||||
if wsl := env.getenv("WSL_DISTRO_NAME"); len(wsl) != 0 {
|
if wsl := env.getenv("WSL_DISTRO_NAME"); len(wsl) != 0 {
|
||||||
platform = strings.ToLower(wsl)
|
platform = strings.ToLower(wsl)
|
||||||
return platform
|
return platform
|
||||||
|
|
Loading…
Reference in a new issue