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

Function GetLocalWshBinaryPath

pkg/util/shellutil/shellutil.go:337–353  ·  view source on GitHub ↗
(version string, goos string, goarch string)

Source from the content-addressed store, hash-verified

335}
336
337func GetLocalWshBinaryPath(version string, goos string, goarch string) (string, error) {
338 ext := ""
339 if goarch == "amd64" {
340 goarch = "x64"
341 }
342 if goarch == "aarch64" {
343 goarch = "arm64"
344 }
345 if goos == "windows" {
346 ext = ".exe"
347 }
348 if !wavebase.SupportedWshBinaries[fmt.Sprintf("%s-%s", goos, goarch)] {
349 return "", fmt.Errorf("unsupported wsh platform: %s-%s", goos, goarch)
350 }
351 baseName := fmt.Sprintf("wsh-%s-%s.%s%s", version, goos, goarch, ext)
352 return filepath.Join(wavebase.GetWaveAppBinPath(), baseName), nil
353}
354
355// absWshBinDir must be an absolute, expanded path (no ~ or $HOME, etc.)
356// it will be hard-quoted appropriately for the shell

Callers 3

CpWshToRemoteFunction · 0.92
CpWshToRemoteFunction · 0.92

Calls 1

GetWaveAppBinPathFunction · 0.92

Tested by

no test coverage detected