Prepare repo for open source

This commit is contained in:
Samraaj Bath
2026-06-29 16:14:44 -07:00
parent 66dfdcc58d
commit 3f7c9ed227
28 changed files with 1461 additions and 574 deletions
+8 -3
View File
@@ -78,9 +78,14 @@ export function serveDir(rootDir: string): Promise<{ url: string; close: () => P
/** Whether a Playwright Chromium browser appears installed (browser tests skip if not). */
export function hasChromium(): boolean {
try {
const base = process.env.PLAYWRIGHT_BROWSERS_PATH || join(homedir(), ".cache", "ms-playwright");
if (!existsSync(base)) return false;
return readdirSync(base).some((d) => d.startsWith("chromium"));
const bases = process.env.PLAYWRIGHT_BROWSERS_PATH
? [process.env.PLAYWRIGHT_BROWSERS_PATH]
: [
join(homedir(), ".cache", "ms-playwright"),
join(homedir(), "Library", "Caches", "ms-playwright"),
...(process.env.LOCALAPPDATA ? [join(process.env.LOCALAPPDATA, "ms-playwright")] : []),
];
return bases.some((base) => existsSync(base) && readdirSync(base).some((d) => d.startsWith("chromium")));
} catch {
return false;
}