@bastani/atomic 0.7.9-1 → 0.7.9

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.
Files changed (2) hide show
  1. package/bin/atomic +18 -1
  2. package/package.json +9 -9
package/bin/atomic CHANGED
@@ -3,6 +3,7 @@
3
3
  "use strict"
4
4
 
5
5
  const childProcess = require("child_process")
6
+ const fs = require("fs")
6
7
  const path = require("path")
7
8
  const os = require("os")
8
9
 
@@ -32,7 +33,23 @@ if (!platform || !arch) {
32
33
  process.exit(1)
33
34
  }
34
35
 
35
- const packageName = "@bastani/atomic-" + platform + "-" + arch
36
+ // Linux ships separate glibc/musl binaries (`@bastani/atomic-linux-<arch>` vs
37
+ // `@bastani/atomic-linux-<arch>-musl`). Without a libc suffix we'd resolve the
38
+ // glibc variant on Alpine, then `spawnSync` fails with ENOENT when the kernel
39
+ // can't find `ld-linux-*.so.2`. Detect via the musl runtime linker on disk —
40
+ // it's the same heuristic the install.sh launcher uses, and it works without
41
+ // pulling in `detect-libc`.
42
+ function libcSuffix() {
43
+ if (platform !== "linux") return ""
44
+ const muslLinker =
45
+ "/lib/ld-musl-" + (arch === "arm64" ? "aarch64" : "x86_64") + ".so.1"
46
+ try {
47
+ if (fs.existsSync(muslLinker)) return "-musl"
48
+ } catch (_) {}
49
+ return ""
50
+ }
51
+
52
+ const packageName = "@bastani/atomic-" + platform + "-" + arch + libcSuffix()
36
53
  const binaryName = "atomic" + (platform === "windows" ? ".exe" : "")
37
54
 
38
55
  let packageJsonPath
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/atomic",
3
- "version": "0.7.9-1",
3
+ "version": "0.7.9",
4
4
  "description": "Configuration management CLI for coding agents",
5
5
  "repository": {
6
6
  "type": "git",
@@ -14,14 +14,14 @@
14
14
  "LICENSE"
15
15
  ],
16
16
  "optionalDependencies": {
17
- "@bastani/atomic-linux-x64": "0.7.9-1",
18
- "@bastani/atomic-linux-arm64": "0.7.9-1",
19
- "@bastani/atomic-linux-x64-musl": "0.7.9-1",
20
- "@bastani/atomic-linux-arm64-musl": "0.7.9-1",
21
- "@bastani/atomic-darwin-x64": "0.7.9-1",
22
- "@bastani/atomic-darwin-arm64": "0.7.9-1",
23
- "@bastani/atomic-windows-x64": "0.7.9-1",
24
- "@bastani/atomic-windows-arm64": "0.7.9-1"
17
+ "@bastani/atomic-linux-x64": "0.7.9",
18
+ "@bastani/atomic-linux-arm64": "0.7.9",
19
+ "@bastani/atomic-linux-x64-musl": "0.7.9",
20
+ "@bastani/atomic-linux-arm64-musl": "0.7.9",
21
+ "@bastani/atomic-darwin-x64": "0.7.9",
22
+ "@bastani/atomic-darwin-arm64": "0.7.9",
23
+ "@bastani/atomic-windows-x64": "0.7.9",
24
+ "@bastani/atomic-windows-arm64": "0.7.9"
25
25
  },
26
26
  "engines": {
27
27
  "node": ">=20"