Launch the local browser
async function openBrowser(url: string) {
const commands: Record<string, string[]> = {
darwin: ["open", url],
windows: ["cmd", "/c", "start", url],
linux: ["xdg-open", url],
};
const cmd = commands[Deno.build.os];
if (cmd) {
const command = new Deno.Command(cmd[0], {
args: cmd.slice(1),
stdout: "null",
stderr: "null",
});
await command.spawn();
}
}