Skip to content

Commit

Permalink
Catch and ignore sync ENOENT error
Browse files Browse the repository at this point in the history
  • Loading branch information
lovell committed Jul 13, 2017
1 parent 0381ad7 commit 5828dfe
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions lib/detect-libc.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,16 @@ if (platform === 'linux') {
version = ldd.stdout.split(/[\r\n]+/)[1].trim().split(/\s/)[1];
} else {
// Try filesystem (family only)
const lib = readdirSync('/lib');
if (lib.some(contains('-linux-gnu'))) {
family = GLIBC;
} else if (lib.some(contains('libc.musl-'))) {
family = MUSL;
} else if (lib.some(contains('ld-musl-'))) {
family = MUSL;
}
try {
const lib = readdirSync('/lib');
if (lib.some(contains('-linux-gnu'))) {
family = GLIBC;
} else if (lib.some(contains('libc.musl-'))) {
family = MUSL;
} else if (lib.some(contains('ld-musl-'))) {
family = MUSL;
}
} catch (e) {}
}
}
}
Expand Down

0 comments on commit 5828dfe

Please sign in to comment.