@codecademy/gamut
68.7.068.7.1-alpha.29afd9.0
bin/lib/claude.mjs~
bin/lib/claude.mjsModified+14−5
Index: package/bin/lib/claude.mjs
===================================================================
--- package/bin/lib/claude.mjs
+++ package/bin/lib/claude.mjs
@@ -14,9 +14,9 @@
text = await readFile(mp, 'utf8');
} catch {
throw new Error(
`Missing ${mp}.\n` +
- `A .claude-plugin/marketplace.json is required for Claude Code installation.`,
+ `A .claude-plugin/marketplace.json is required for Claude Code installation.`
);
}
const json =
@@ -25,16 +25,22 @@
);
const { name: marketplaceName, plugins } = json;
if (!marketplaceName || !Array.isArray(plugins) || plugins.length === 0) {
- throw new Error(`Invalid marketplace.json — needs "name" and "plugins[]": ${mp}`);
+ throw new Error(
+ `Invalid marketplace.json — needs "name" and "plugins[]": ${mp}`
+ );
}
const entry =
- plugins.find((p) => p.source === './' || p.source === '.' || p.source == null) ?? plugins[0];
+ plugins.find(
+ (p) => p.source === './' || p.source === '.' || p.source == null
+ ) ?? plugins[0];
if (!entry?.name) {
- throw new Error(`No plugin name found in marketplace.json plugins[]: ${mp}`);
+ throw new Error(
+ `No plugin name found in marketplace.json plugins[]: ${mp}`
+ );
}
return `${entry.name}@${marketplaceName}`;
}
@@ -46,7 +52,10 @@
* @returns {string}
*/
export function marketplaceName(spec) {
const name = spec.split('@')[1];
- if (!name) throw new Error(`Could not parse marketplace name from plugin spec: ${spec}`);
+ if (!name)
+ throw new Error(
+ `Could not parse marketplace name from plugin spec: ${spec}`
+ );
return name;
}