MCPcopy Create free account
hub / github.com/AndroidPoet/playconsole-cli / openBrowser

Function openBrowser

internal/api/enablement.go:173–188  ·  view source on GitHub ↗

openBrowser opens a URL in the default browser

(url string)

Source from the content-addressed store, hash-verified

171
172// openBrowser opens a URL in the default browser
173func openBrowser(url string) error {
174 var cmd *exec.Cmd
175
176 switch runtime.GOOS {
177 case "darwin":
178 cmd = exec.Command("open", url)
179 case "linux":
180 cmd = exec.Command("xdg-open", url)
181 case "windows":
182 cmd = exec.Command("rundll32", "url.dll,FileProtocolHandler", url)
183 default:
184 return fmt.Errorf("unsupported platform")
185 }
186
187 return cmd.Start()
188}
189
190// copyToClipboard copies text to the system clipboard
191func copyToClipboard(text string) error {

Callers 1

HandleAPIEnablementFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected