Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions workflows/coder/check/check-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -653,12 +653,22 @@ if (staticRoot) {

// The sandbox setup unpacks Chrome's headless shell under $HOME/browsers. A sandboxed process may not
// register Mach services, so Chrome runs as one process with its own sandbox off.
const [chrome] = await Array.fromAsync(
new Bun.Glob("chrome-headless-shell-*/chrome-headless-shell").scan({
cwd: join(homedir(), "browsers"),
absolute: true,
}),
);
// With no browser installed the folder is not there at all, which is the same finding.
const installedBrowsers = async () => {
try {
return await Array.fromAsync(
new Bun.Glob("chrome-headless-shell-*/chrome-headless-shell").scan({
cwd: join(homedir(), "browsers"),
absolute: true,
}),
);
} catch (error) {
if (error instanceof Error && "code" in error && error.code === "ENOENT")
return [];
throw error;
}
};
const [chrome] = await installedBrowsers();
if (!chrome) {
stop();
fail("browser", "nothing under $HOME/browsers");
Expand Down