MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / detectLinuxDistro

Function detectLinuxDistro

packages/cli/src/browser/linuxDeps.ts:166–181  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

164 * /etc/os-release; falls back to "unknown" when it can't be read or matched.
165 */
166export function detectLinuxDistro(): LinuxDistroInfo {
167 const isWsl = detectWSL();
168 try {
169 const contents = readFileSync("/etc/os-release", "utf-8");
170 const parsed = parseOsRelease(contents);
171 const family = distroFamilyFromOsRelease(parsed["ID"], parsed["ID_LIKE"]);
172 return {
173 family,
174 ...(parsed["ID"] ? { id: parsed["ID"] } : {}),
175 ...(parsed["PRETTY_NAME"] ? { prettyName: parsed["PRETTY_NAME"] } : {}),
176 isWsl,
177 };
178 } catch {
179 return { family: "unknown", isWsl };
180 }
181}
182
183/**
184 * Build the exact command to install the full Chrome shared-library set for a

Callers 3

chromeSharedLibOutcomeFunction · 0.85
getFFmpegInstallHintFunction · 0.85
chromeLaunchRemediationFunction · 0.85

Calls 3

detectWSLFunction · 0.85
parseOsReleaseFunction · 0.85

Tested by

no test coverage detected