refactor(build): share Cursor plugin metadata reads (#16382)

This commit is contained in:
Vincent Koc authored and GitHub committed 2026-12-03 14:56:48 +00:00
1 parent 51475a6341
commit d470cc88b6
1 file changed
+5 -7
+5 -7
View File
@@ -164,13 +164,11 @@ export const syncCursorPluginSkill = async ({ root, check }) => {
/** Read the committed plugin and report structured contract issues. */
export const inspectCursorPluginBundle = async (root) => {
const manifest = JSON.parse(
await readFile(join(root, CURSOR_PLUGIN_MANIFEST), "utf8"),
);
const mcp = JSON.parse(await readFile(join(root, CURSOR_PLUGIN_MCP), "utf8"));
const packageJson = JSON.parse(
await readFile(join(root, "package.json"), "utf8"),
);
const readJson = async (relativePath) =>
JSON.parse(await readFile(join(root, relativePath), "utf8"));
const manifest = await readJson(CURSOR_PLUGIN_MANIFEST);
const mcp = await readJson(CURSOR_PLUGIN_MCP);
const packageJson = await readJson("package.json");
const logoExists = await stat(join(root, CURSOR_PLUGIN_LOGO))
.then((metadata) => metadata.isFile())
.catch((cause) => {