mirror of
https://github.com/addyosmani/agent-skills.git
synced 2026-08-12 18:07:26 +02:00
Fix plugin manifest version consistency
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
"use strict";
|
||||
|
||||
const { execFileSync } = require("node:child_process");
|
||||
const { readFileSync } = require("node:fs");
|
||||
|
||||
const manifestPaths = [
|
||||
"plugin.json",
|
||||
".codex-plugin/plugin.json",
|
||||
".claude-plugin/plugin.json",
|
||||
".claude-plugin/marketplace.json",
|
||||
".agents/plugins/marketplace.json",
|
||||
];
|
||||
|
||||
function readManifestVersion(manifestPath) {
|
||||
const manifest = JSON.parse(readFileSync(manifestPath, "utf8"));
|
||||
return manifest.version ?? manifest.plugins?.[0]?.version;
|
||||
}
|
||||
|
||||
const expectedVersion = execFileSync(
|
||||
"git",
|
||||
["describe", "--tags", "--abbrev=0"],
|
||||
{ encoding: "utf8" },
|
||||
).trim();
|
||||
|
||||
for (const manifestPath of manifestPaths) {
|
||||
const version = readManifestVersion(manifestPath);
|
||||
if (version !== expectedVersion) {
|
||||
throw new Error(
|
||||
`${manifestPath} has version ${version ?? "<missing>"}; expected ${expectedVersion}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
console.log(`All plugin manifests use version ${expectedVersion}.`);
|
||||
Reference in New Issue
Block a user