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

Function GetClientPlatformFromOsArchStr

pkg/wslconn/wsl-util.go:86–96  ·  view source on GitHub ↗
(ctx context.Context, osArchStr string)

Source from the content-addressed store, hash-verified

84}
85
86func GetClientPlatformFromOsArchStr(ctx context.Context, osArchStr string) (string, string, error) {
87 parts := strings.Fields(strings.TrimSpace(osArchStr))
88 if len(parts) != 2 {
89 return "", "", fmt.Errorf("unexpected output from uname: %s", osArchStr)
90 }
91 os, arch := normalizeOs(parts[0]), normalizeArch(parts[1])
92 if err := wavebase.ValidateWshSupportedArch(os, arch); err != nil {
93 return "", "", err
94 }
95 return os, arch, nil
96}
97
98type CancellableCmd struct {
99 Cmd *wsl.WslCmd

Callers 1

InstallWshMethod · 0.70

Calls 3

ValidateWshSupportedArchFunction · 0.92
normalizeOsFunction · 0.70
normalizeArchFunction · 0.70

Tested by

no test coverage detected