diff --git a/mod.ts b/mod.ts index 7855426..1c12df2 100755 --- a/mod.ts +++ b/mod.ts @@ -1,5 +1,6 @@ import { Command } from 'https://deno.land/x/cliffy@v1.0.0-rc.4/command/mod.ts' import { z } from 'https://deno.land/x/zod@v3.23.8/mod.ts' +import { open } from 'https://deno.land/x/opener/mod.ts' const sockets: Set = new Set([]) @@ -46,11 +47,8 @@ async function openBrowser(args: Args): Promise { if (args.open) { // TODO: this is broken? const url = `http://${args.host}:${args.port}` - console.log(`opening browser to ${url}`) - const process = new Deno.Command('xdg-open', { - args: [url], - }).spawn() - console.log(`opened browser to ${url}: ${await process.status}`) + console.log(`Opening ${url} in web browser...`) + await open(url) } }