Skip to content

Commit

Permalink
Fix checkPlatform takes an insane amount of time to complete when use…
Browse files Browse the repository at this point in the history
…d in a loop
  • Loading branch information
Tofandel committed Oct 28, 2024
1 parent 4751cb4 commit d2bba65
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions lib/current-env.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,8 @@ function cpu () {
return process.arch
}

function libc (osName) {
// this is to make it faster on non linux machines
if (osName !== 'linux') {
return undefined
}
let family
let family
if (os() === 'linux') {
const originalExclude = process.report.excludeNetwork
process.report.excludeNetwork = true
const report = process.report.getReport()
Expand All @@ -28,6 +24,11 @@ function libc (osName) {
} else if (Array.isArray(report.sharedObjects) && report.sharedObjects.some(isMusl)) {
family = 'musl'
}
}
function libc (osName) {
if (osName !== 'linux') {
return undefined
}
return family
}

Expand Down

0 comments on commit d2bba65

Please sign in to comment.