mirror of
https://github.com/thedotmack/claude-mem
synced 2026-04-25 17:15:04 +02:00
fix: harden plugin manifest sync script
This commit is contained in:
@@ -20,6 +20,9 @@ function writeJson(filePath, value) {
|
||||
}
|
||||
|
||||
function syncCodexPlugin(plugin, pkg) {
|
||||
const author =
|
||||
typeof plugin.author === 'object' && plugin.author ? plugin.author : {};
|
||||
|
||||
return {
|
||||
...plugin,
|
||||
name: pkg.name,
|
||||
@@ -30,7 +33,7 @@ function syncCodexPlugin(plugin, pkg) {
|
||||
license: pkg.license,
|
||||
keywords: pkg.keywords,
|
||||
author: {
|
||||
...(plugin.author ?? {}),
|
||||
...author,
|
||||
name: normalizeAuthorName(pkg.author),
|
||||
},
|
||||
interface: {
|
||||
@@ -72,6 +75,13 @@ function normalizeRepositoryUrl(repository) {
|
||||
}
|
||||
|
||||
function main() {
|
||||
for (const filePath of [packageJsonPath, codexPluginPath, claudePluginPath]) {
|
||||
if (!fs.existsSync(filePath)) {
|
||||
console.error(`Missing required file: ${filePath}`);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
const pkg = readJson(packageJsonPath);
|
||||
const codexPlugin = readJson(codexPluginPath);
|
||||
const claudePlugin = readJson(claudePluginPath);
|
||||
|
||||
Reference in New Issue
Block a user