super-release 0.9.0 → 0.11.0

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.
@@ -32,13 +32,37 @@ try {
32
32
  });
33
33
  process.exit(0);
34
34
  } catch (err) {
35
+ if (err.code === "ENOENT" || err.code === "EACCES") {
36
+ console.error(`super-release: binary not found or not executable at ${binPath}`);
37
+ console.error(err);
38
+ } else if (err.status === null) {
39
+ // No exit status = binary couldn't run at all (wrong libc, missing interpreter)
40
+ console.error(`super-release: failed to execute binary at ${binPath}`);
41
+ console.error(`If running on Alpine/musl, ensure the musl build is being downloaded.`);
42
+ console.error(err);
43
+ }
35
44
  process.exit(err.status ?? 1);
36
45
  }
37
46
 
47
+ function isMusl() {
48
+ try {
49
+ // ldd --version outputs to stderr on musl and exits non-zero
50
+ const result = execFileSync("ldd", ["--version"], { stdio: ["pipe", "pipe", "pipe"] });
51
+ return result.toString().includes("musl");
52
+ } catch (err) {
53
+ // On musl, ldd exits with error but stderr contains "musl"
54
+ if (err.stderr && err.stderr.toString().includes("musl")) {
55
+ return true;
56
+ }
57
+ return existsSync("/lib/ld-musl-x86_64.so.1") || existsSync("/lib/ld-musl-aarch64.so.1");
58
+ }
59
+ }
60
+
38
61
  async function install() {
39
62
  const REPO = "bowlingx/super-release";
63
+ const musl = platform() === "linux" && isMusl();
40
64
  const PLATFORM_MAP = {
41
- "linux-x64": "super-release-linux-x86_64",
65
+ "linux-x64": musl ? "super-release-linux-x86_64-musl" : "super-release-linux-x86_64",
42
66
  "linux-arm64": "super-release-linux-aarch64",
43
67
  "darwin-x64": "super-release-darwin-x86_64",
44
68
  "darwin-arm64": "super-release-darwin-aarch64",
package/package.json CHANGED
@@ -28,7 +28,7 @@
28
28
  "url": "git+https://github.com/BowlingX/super-release.git"
29
29
  },
30
30
  "type": "module",
31
- "version": "0.9.0",
31
+ "version": "0.11.0",
32
32
  "scripts": {
33
33
  "super-release": "node npm/bin/super-release.js"
34
34
  }