diff --git a/lib/current-env.js b/lib/current-env.js index 92134c3..9f3b3d9 100644 --- a/lib/current-env.js +++ b/lib/current-env.js @@ -14,21 +14,22 @@ function cpu () { } let family -if (os() === 'linux') { - const originalExclude = process.report.excludeNetwork - process.report.excludeNetwork = true - const report = process.report.getReport() - process.report.excludeNetwork = originalExclude - if (report.header?.glibcVersionRuntime) { - family = 'glibc' - } else if (Array.isArray(report.sharedObjects) && report.sharedObjects.some(isMusl)) { - family = 'musl' - } -} function libc (osName) { if (osName !== 'linux') { return undefined } + + if (!family) { + const originalExclude = process.report.excludeNetwork + process.report.excludeNetwork = true + const report = process.report.getReport() + process.report.excludeNetwork = originalExclude + if (report.header?.glibcVersionRuntime) { + family = 'glibc' + } else if (Array.isArray(report.sharedObjects) && report.sharedObjects.some(isMusl)) { + family = 'musl' + } + } return family }