Publish Claude Code Binaries / Stage and publish binaries (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-arm64 (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build linux-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build windows-amd64 (push) Canceled after 0s
Sync Tutti Agent Skills / sync (push) Canceled after 0s
Windows Agent Adapters / Test Windows agent adapters (push) Canceled after 0s
Windows Daemon Adapters / Test Windows daemon adapters (push) Canceled after 0s
Publish Tutti App Runtime / Publish runtime catalog (push) Canceled after 0s
34 lines
806 B
Go
34 lines
806 B
Go
//go:build windows
|
|
|
|
package agentextension
|
|
|
|
import (
|
|
"context"
|
|
"os"
|
|
"os/exec"
|
|
"path/filepath"
|
|
"strings"
|
|
)
|
|
|
|
func newAgentExtensionCommand(ctx context.Context, executable string, args ...string) *exec.Cmd {
|
|
switch strings.ToLower(filepath.Ext(executable)) {
|
|
case ".cmd", ".bat":
|
|
// npm and pnpm are batch launchers on Windows and cannot be passed
|
|
// directly to CreateProcess. Preserve structured argv through cmd.exe.
|
|
return exec.CommandContext(
|
|
ctx,
|
|
agentExtensionCommandInterpreter(),
|
|
append([]string{"/D", "/S", "/C", "call", executable}, args...)...,
|
|
)
|
|
default:
|
|
return exec.CommandContext(ctx, executable, args...)
|
|
}
|
|
}
|
|
|
|
func agentExtensionCommandInterpreter() string {
|
|
if value := strings.TrimSpace(os.Getenv("ComSpec")); value != "" {
|
|
return value
|
|
}
|
|
return "cmd.exe"
|
|
}
|