diff --git a/scripts/lib/cursor-plugin-bundle.mjs b/scripts/lib/cursor-plugin-bundle.mjs index d215a079913..8cefec74931 100644 --- a/scripts/lib/cursor-plugin-bundle.mjs +++ b/scripts/lib/cursor-plugin-bundle.mjs @@ -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) => {