()
| 164 | * /etc/os-release; falls back to "unknown" when it can't be read or matched. |
| 165 | */ |
| 166 | export 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 |
no test coverage detected