@avesta-hq/prevention 0.6.0-pre.3 → 0.6.0-pre.4

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/lib/utils.js +16 -9
  2. package/package.json +1 -1
package/bin/lib/utils.js CHANGED
@@ -70,16 +70,23 @@ function getPlatformBinaryName() {
70
70
  }
71
71
 
72
72
  function getLatestVersion() {
73
- try {
74
- const result = execSync(
75
- `curl -sI "https://github.com/${GITHUB_RELEASES_REPO}/releases/latest" | grep -i ^location:`,
76
- { encoding: 'utf8', timeout: 10000 }
77
- );
78
- const match = result.match(/\/tag\/(v[^\s\r\n]+)/);
79
- return match ? match[1] : null;
80
- } catch {
81
- return null;
73
+ // Use package version to match the corresponding GitHub Release
74
+ const pkgVersion = `v${getVersion()}`;
75
+
76
+ // For stable releases, verify the release exists via GitHub latest redirect
77
+ // (handles partial release failures where npm published but binary upload failed)
78
+ if (!pkgVersion.includes('-pre')) {
79
+ try {
80
+ const result = execSync(
81
+ `curl -sI "https://github.com/${GITHUB_RELEASES_REPO}/releases/latest" | grep -i ^location:`,
82
+ { encoding: 'utf8', timeout: 10000 }
83
+ );
84
+ const match = result.match(/\/tag\/(v[^\s\r\n]+)/);
85
+ if (match) return match[1];
86
+ } catch {}
82
87
  }
88
+
89
+ return pkgVersion;
83
90
  }
84
91
 
85
92
  function downloadBinary(targetDir) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@avesta-hq/prevention",
3
- "version": "0.6.0-pre.3",
3
+ "version": "0.6.0-pre.4",
4
4
  "description": "XP/CD development agent commands for Claude Code - achieve Elite DORA metrics through disciplined TDD and Continuous Delivery practices",
5
5
  "keywords": [
6
6
  "claude-code",