MCPcopy
hub / github.com/garrytan/gstack / tryOpen

Function tryOpen

make-pdf/src/orchestrator.ts:384–396  ·  view source on GitHub ↗
(pathOrUrl: string)

Source from the content-addressed store, hash-verified

382}
383
384function tryOpen(pathOrUrl: string): void {
385 const platform = process.platform;
386 const cmd = platform === "darwin" ? "open" :
387 platform === "win32" ? "cmd" :
388 "xdg-open";
389 const args = platform === "win32" ? ["/c", "start", "", pathOrUrl] : [pathOrUrl];
390 try {
391 const child = spawn(cmd, args, { detached: true, stdio: "ignore" });
392 child.unref();
393 } catch {
394 // Non-fatal; the caller already has the path and will print it.
395 }
396}
397
398/** Setup-only re-export so cli.ts can dynamic-import without another file. */
399export { ExitCode };

Callers 1

previewFunction · 0.85

Calls 1

spawnFunction · 0.85

Tested by

no test coverage detected