mirror of
https://github.com/badlogic/pi-mono.git
synced 2026-07-09 17:28:45 +00:00
fix(oauth): harden browser launch handling
This commit is contained in:
parent
a98e087e5d
commit
ba6e5298df
6 changed files with 138 additions and 17 deletions
|
|
@ -3,7 +3,7 @@
|
|||
import { existsSync, mkdirSync, readdirSync, readFileSync, writeFileSync } from "node:fs";
|
||||
import { homedir, tmpdir } from "node:os";
|
||||
import { join, resolve } from "node:path";
|
||||
import { spawn } from "node:child_process";
|
||||
import { openBrowser } from "../packages/coding-agent/src/utils/open-browser.ts";
|
||||
|
||||
interface TextContent { type: "text"; text: string }
|
||||
interface ImageContent { type: "image"; data: string; mimeType?: string }
|
||||
|
|
@ -229,4 +229,4 @@ const html = `<!doctype html>
|
|||
mkdirSync(resolve(output, ".."), { recursive: true });
|
||||
writeFileSync(output, html);
|
||||
console.log(`Wrote ${output}`);
|
||||
spawn(process.platform === "darwin" ? "open" : process.platform === "win32" ? "cmd" : "xdg-open", process.platform === "win32" ? ["/c", "start", output] : [output], { detached: true, stdio: "ignore" }).unref();
|
||||
openBrowser(output);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue