[autofix.ci] apply automated fixes

This commit is contained in:
autofix-ci[bot]
2025-08-04 00:51:31 +00:00
committed by GitHub
parent 683acaac91
commit f0aaa2003a
2 changed files with 6 additions and 9 deletions

View File

@@ -128,7 +128,7 @@ export default function (
if (protocol.includes("ws")) {
const debugUrl = `https://debug.bun.sh/#${host}${pathname}`;
Bun.write(Bun.stderr, `Inspect in browser:\n ${link(debugUrl)}\n`);
// Open browser if requested
if (openInBrowser) {
openUrlInBrowser(debugUrl);
@@ -647,12 +647,9 @@ function openUrlInBrowser(url: string): void {
// Use Bun.spawn in a detached way to open the browser without blocking
// Similar to how bun create does it using openURL
try {
const opener = process.platform === "darwin"
? "/usr/bin/open"
: process.platform === "win32"
? "start"
: "xdg-open";
const opener =
process.platform === "darwin" ? "/usr/bin/open" : process.platform === "win32" ? "start" : "xdg-open";
// Spawn without awaiting to avoid blocking
Bun.spawn([opener, url], {
stdio: ["ignore", "ignore", "ignore"],

View File

@@ -1,4 +1,4 @@
import { test, expect } from "bun:test";
import { expect, test } from "bun:test";
import { bunEnv, bunExe, tempDirWithFiles } from "harness";
// Tests for the --inspect-browser flag functionality
@@ -167,4 +167,4 @@ test.skipIf(!isLinux)("--inspect-browser should work with script that has spaces
expect(stderr).toContain("Bun Inspector");
expect(stderr).toContain("Inspect in browser:");
expect(stderr).toContain("https://debug.bun.sh");
});
});