mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 18:38:55 +00:00
[autofix.ci] apply automated fixes
This commit is contained in:
@@ -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"],
|
||||
|
||||
@@ -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");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user