@biomejs/biome 1.3.3 → 1.4.1-nightly.22dd4e1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,20 @@
1
1
  const { platform, arch } = process;
2
+ const { execSync } = require("child_process");
3
+
4
+ function isMusl() {
5
+ let stderr;
6
+ try {
7
+ stderr = execSync("ldd --version", {
8
+ stdio: ['pipe', 'pipe', 'pipe']
9
+ });
10
+ } catch (err) {
11
+ stderr = err.stderr;
12
+ }
13
+ if (stderr.indexOf("musl") > -1) {
14
+ return true;
15
+ }
16
+ return false;
17
+ }
2
18
 
3
19
  const PLATFORMS = {
4
20
  win32: {
@@ -13,9 +29,17 @@ const PLATFORMS = {
13
29
  x64: "@biomejs/cli-linux-x64/biome",
14
30
  arm64: "@biomejs/cli-linux-arm64/biome",
15
31
  },
32
+ "linux-musl": {
33
+ x64: "@biomejs/cli-linux-x64-musl/biome",
34
+ arm64: "@biomejs/cli-linux-arm64-musl/biome",
35
+ },
16
36
  };
17
37
 
18
- const binName = PLATFORMS?.[platform]?.[arch];
38
+ const binName =
39
+ platform === "linux" && isMusl()
40
+ ? PLATFORMS?.["linux-musl"]?.[arch]
41
+ : PLATFORMS?.[platform]?.[arch];
42
+
19
43
  if (binName) {
20
44
  let binPath;
21
45
  try {