Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Commit

Permalink
system: add a fallback for musl detection
Browse files Browse the repository at this point in the history
Bug: #222
  • Loading branch information
jesec committed May 3, 2022
1 parent 2030888 commit e400318
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/system.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import fs from 'fs';
import { spawnSync } from 'child_process';

function getHostAbi() {
Expand Down Expand Up @@ -44,7 +45,11 @@ function detectAlpine() {
}

// https://github.com/sass/node-sass/issues/1589#issuecomment-265292579
const ldd = spawnSync('ldd').stderr.toString();
const ldd = spawnSync('ldd').stderr?.toString();

if (ldd == null) {
return fs.readdirSync('/lib').some((file) => file.startsWith('libc.musl'));
}

if (/\bmusl\b/.test(ldd)) {
return true;
Expand Down

0 comments on commit e400318

Please sign in to comment.