MCPcopy Create free account
hub / github.com/compozy/agh / openBrowser

Function openBrowser

internal/cli/open.go:39–50  ·  view source on GitHub ↗
(ctx context.Context, url string)

Source from the content-addressed store, hash-verified

37}
38
39func openBrowser(ctx context.Context, url string) error {
40 var cmd *exec.Cmd
41 switch runtime.GOOS {
42 case "darwin":
43 cmd = exec.CommandContext(ctx, "open", url)
44 case "windows":
45 cmd = exec.CommandContext(ctx, "cmd", "/c", "start", url)
46 default:
47 cmd = exec.CommandContext(ctx, "xdg-open", url)
48 }
49 return cmd.Start()
50}

Callers 1

newOpenCommandFunction · 0.85

Calls 1

StartMethod · 0.65

Tested by

no test coverage detected