Skip to content

Commit

Permalink
Ignore docker-desktop WSL distros
Browse files Browse the repository at this point in the history
  • Loading branch information
shayne committed Mar 11, 2020
1 parent 67561b5 commit d9a11d5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/wslapi/wslapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import (
"github.com/shayne/go-wsl2-host/pkg/wslcli"
)

const dockerDesktopDistros = "docker-desktop"

// DistroInfo data structure for state of a WSL distro
type DistroInfo struct {
Name string
Expand Down Expand Up @@ -49,6 +51,9 @@ func GetAllInfo() ([]*DistroInfo, error) {
return nil, fmt.Errorf("invalid field length for distro: %q", line)
}
info.Name = fields[0]
if strings.HasPrefix(info.Name, dockerDesktopDistros) {
continue
}
info.Running = fields[1] == "Running"
version, err := strconv.ParseInt(fields[2], 10, 0)
if err != nil {
Expand Down

0 comments on commit d9a11d5

Please sign in to comment.