MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / openerFor

Function openerFor

src/artifacts/open-browser.ts:33–38  ·  view source on GitHub ↗

The platform-appropriate opener command + args for a URL.

(url: string, platform: string)

Source from the content-addressed store, hash-verified

31
32/** The platform-appropriate opener command + args for a URL. */
33function openerFor(url: string, platform: string): { cmd: string; args: string[] } {
34 if (platform === 'darwin') return { cmd: 'open', args: [url] };
35 if (platform === 'win32') return { cmd: 'cmd', args: ['/c', 'start', '', url] };
36 // linux / *bsd and the rest
37 return { cmd: 'xdg-open', args: [url] };
38}
39
40/**
41 * Try to open `url` in the default browser. Resolves `true` if the opener was

Callers 1

openUrlFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected