(version string, goos string, goarch string)
| 335 | } |
| 336 | |
| 337 | func 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 |
no test coverage detected