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

Function distroFamilyFromOsRelease

packages/cli/src/browser/linuxDeps.ts:134–141  ·  view source on GitHub ↗
(id?: string, idLike?: string)

Source from the content-addressed store, hash-verified

132 * Exported for direct unit testing without touching the filesystem.
133 */
134export function distroFamilyFromOsRelease(id?: string, idLike?: string): LinuxDistroFamily {
135 const haystack = `${id ?? ""} ${idLike ?? ""}`.toLowerCase();
136 if (/\b(debian|ubuntu|linuxmint|pop|elementary|raspbian|kali)\b/.test(haystack)) return "debian";
137 if (/\b(fedora|rhel|centos|rocky|almalinux|amzn|ol)\b/.test(haystack)) return "fedora";
138 if (/\b(arch|manjaro|endeavouros|garuda)\b/.test(haystack)) return "arch";
139 if (/\b(alpine)\b/.test(haystack)) return "alpine";
140 return "unknown";
141}
142
143/** Parse the shell-style key=value contents of /etc/os-release. */
144export function parseOsRelease(contents: string): Record<string, string> {

Callers 2

linuxDeps.test.tsFile · 0.85
detectLinuxDistroFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected