MCPcopy
hub / github.com/wavetermdev/waveterm / GetDistro

Function GetDistro

pkg/wsl/wsl-win.go:128–141  ·  view source on GitHub ↗
(ctx context.Context, wslDistroName WslName)

Source from the content-addressed store, hash-verified

126}
127
128func GetDistro(ctx context.Context, wslDistroName WslName) (*Distro, error) {
129 distros, err := RegisteredDistros(ctx)
130 if err != nil {
131 return nil, err
132 }
133 for _, distro := range distros {
134 if distro.Name() != wslDistroName.Distro {
135 continue
136 }
137 wrappedDistro := Distro{distro}
138 return &wrappedDistro, nil
139 }
140 return nil, fmt.Errorf("wsl distro %s not found", wslDistroName)
141}

Callers 1

connectInternalMethod · 0.92

Calls 2

RegisteredDistrosFunction · 0.85
NameMethod · 0.45

Tested by

no test coverage detected