@klarlabs-studio/warden 0.32.0 → 0.32.2
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.
- package/bin/warden.cjs +36 -5
- package/package.json +7 -7
package/bin/warden.cjs
CHANGED
|
@@ -18,13 +18,44 @@ function binaryPath() {
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
// Whether warden PUBLISHES a binary for this platform, which is a different
|
|
22
|
+
// question from whether one is installed. The wrapper's own
|
|
23
|
+
// optionalDependencies list every platform package built for this release, so
|
|
24
|
+
// it answers the first question without a network call.
|
|
25
|
+
function isPublishedPlatform(pkg) {
|
|
26
|
+
try {
|
|
27
|
+
const own = require("../package.json");
|
|
28
|
+
return Object.prototype.hasOwnProperty.call(own.optionalDependencies || {}, pkg);
|
|
29
|
+
} catch {
|
|
30
|
+
// Cannot tell. Say the weaker thing rather than guess.
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
21
35
|
const bin = binaryPath();
|
|
22
36
|
if (!bin) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
37
|
+
// These two failures look identical here and have opposite fixes, so they
|
|
38
|
+
// must not share a message. Telling someone their platform is unsupported
|
|
39
|
+
// when the real problem is a missing install sends them to build from source
|
|
40
|
+
// to solve something a reinstall fixes.
|
|
41
|
+
const pkg = `@klarlabs-studio/warden-${process.platform}-${process.arch}`;
|
|
42
|
+
if (isPublishedPlatform(pkg)) {
|
|
43
|
+
console.error(
|
|
44
|
+
`warden: ${pkg} is published for this release but is not installed here.\n` +
|
|
45
|
+
`This is an install problem, not an unsupported platform. Common causes:\n` +
|
|
46
|
+
` - installed with --no-optional or --omit=optional, which skips it\n` +
|
|
47
|
+
` - the release published minutes ago and the registry has not caught up\n` +
|
|
48
|
+
` - a partial or interrupted install\n` +
|
|
49
|
+
`Try: npm install ${pkg}\n` +
|
|
50
|
+
`Binaries: https://github.com/klarlabs-studio/warden/releases`,
|
|
51
|
+
);
|
|
52
|
+
} else {
|
|
53
|
+
console.error(
|
|
54
|
+
`warden: no prebuilt binary for ${process.platform}-${process.arch}.\n` +
|
|
55
|
+
`Install another way: https://github.com/klarlabs-studio/warden/releases ` +
|
|
56
|
+
`or 'go install go.klarlabs.de/warden@latest'.`,
|
|
57
|
+
);
|
|
58
|
+
}
|
|
28
59
|
process.exit(1);
|
|
29
60
|
}
|
|
30
61
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@klarlabs-studio/warden",
|
|
3
3
|
"_version_comment": "Set at publish time by npm/scripts/build-packages.mjs from the git tag; the literal below is never published. optionalDependencies are rewritten the same way.",
|
|
4
|
-
"version": "0.32.
|
|
4
|
+
"version": "0.32.2",
|
|
5
5
|
"description": "Configurable git commit/push gate — native hooks, worktree isolation, cryptographic provenance. Wraps the warden binary so `npx @klarlabs-studio/warden` works with no Go toolchain.",
|
|
6
6
|
"bin": {
|
|
7
7
|
"warden": "bin/warden.cjs"
|
|
@@ -11,12 +11,12 @@
|
|
|
11
11
|
"README.md"
|
|
12
12
|
],
|
|
13
13
|
"optionalDependencies": {
|
|
14
|
-
"@klarlabs-studio/warden-linux-x64": "0.32.
|
|
15
|
-
"@klarlabs-studio/warden-linux-arm64": "0.32.
|
|
16
|
-
"@klarlabs-studio/warden-darwin-x64": "0.32.
|
|
17
|
-
"@klarlabs-studio/warden-darwin-arm64": "0.32.
|
|
18
|
-
"@klarlabs-studio/warden-win32-x64": "0.32.
|
|
19
|
-
"@klarlabs-studio/warden-win32-arm64": "0.32.
|
|
14
|
+
"@klarlabs-studio/warden-linux-x64": "0.32.2",
|
|
15
|
+
"@klarlabs-studio/warden-linux-arm64": "0.32.2",
|
|
16
|
+
"@klarlabs-studio/warden-darwin-x64": "0.32.2",
|
|
17
|
+
"@klarlabs-studio/warden-darwin-arm64": "0.32.2",
|
|
18
|
+
"@klarlabs-studio/warden-win32-x64": "0.32.2",
|
|
19
|
+
"@klarlabs-studio/warden-win32-arm64": "0.32.2"
|
|
20
20
|
},
|
|
21
21
|
"keywords": [
|
|
22
22
|
"git",
|