fix(wsl): get correct distro name

This commit is contained in:
L. Yeung 2022-03-19 03:40:40 +08:00 committed by Jan De Dobbeleer
parent 2ff5b87f97
commit 0f489ec88e

View file

@ -65,8 +65,8 @@ func (env *ShellEnvironment) Platform() string {
env.Cache().Set(key, platform, -1) 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.Split(strings.ToLower(wsl), "-")[0]
return strings.Split(platform, "-")[0] return platform
} }
platform, _, _, _ = host.PlatformInformation() platform, _, _, _ = host.PlatformInformation()
if platform == "arch" { if platform == "arch" {