mirror of
https://github.com/podman-container-tools/podman.git
synced 2026-10-21 21:37:38 +00:00
Merge pull request #20243 from openshift-cherrypick-robot/cherry-pick-20240-to-v4.7
[v4.7] Fix locale issues with WSL version detection
This commit is contained in:
commit
e82b43475f
1 changed files with 3 additions and 10 deletions
|
|
@ -50,20 +50,13 @@ func IsWSLInstalled() bool {
|
|||
|
||||
func IsWSLStoreVersionInstalled() bool {
|
||||
cmd := SilentExecCmd("wsl", "--version")
|
||||
out, err := cmd.StdoutPipe()
|
||||
cmd.Stdout = nil
|
||||
cmd.Stderr = nil
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
if err = cmd.Start(); err != nil {
|
||||
return false
|
||||
}
|
||||
hasVersion := matchOutputLine(out, "WSL version:")
|
||||
if err := cmd.Wait(); err != nil {
|
||||
if err := cmd.Run(); err != nil {
|
||||
return false
|
||||
}
|
||||
|
||||
return hasVersion
|
||||
return true
|
||||
}
|
||||
|
||||
func matchOutputLine(output io.ReadCloser, match string) bool {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue