mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-10 22:20:14 +00:00
feat(studio): make agent edits live and explicit (#3581)
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import { existsSync, readdirSync } from "node:fs";
|
||||
import { homedir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
|
||||
/** Resolve the same Chrome binary for every local Studio browser acceptance test. */
|
||||
export function resolveChromeExecutable() {
|
||||
const chromeRoot = join(homedir(), ".cache", "puppeteer", "chrome");
|
||||
const builds = existsSync(chromeRoot) ? readdirSync(chromeRoot).sort().reverse() : [];
|
||||
const installed = builds.flatMap((build) =>
|
||||
[
|
||||
"chrome-mac-arm64/Google Chrome for Testing.app/Contents/MacOS/Google Chrome for Testing",
|
||||
"chrome-mac-x64/Google Chrome for Testing.app/Contents/MacOS/Google Chrome for Testing",
|
||||
"chrome-linux64/chrome",
|
||||
].map((relative) => join(chromeRoot, build, relative)),
|
||||
);
|
||||
return [
|
||||
process.env.PUPPETEER_EXECUTABLE_PATH,
|
||||
process.env.CHROME_PATH,
|
||||
"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",
|
||||
"/usr/bin/google-chrome",
|
||||
"/usr/bin/chromium",
|
||||
...installed,
|
||||
].find((candidate) => candidate && existsSync(candidate));
|
||||
}
|
||||
Reference in New Issue
Block a user