mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-11-10 04:54:03 -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
|
||||
}
|
||||
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 {
|
||||
platform = strings.ToLower(wsl)
|
||||
return platform
|
||||
|
|
Loading…
Reference in a new issue