Plugins: clean stale bundled skill outputs

This commit is contained in:
Gustavo Madeira Santana
2026-03-15 21:48:09 +00:00
parent 50a6902a9a
commit 14137bef22
3 changed files with 56 additions and 7 deletions

View File

@@ -110,6 +110,12 @@ export function copyBundledPluginMetadata(params = {}) {
}
const sourcePluginDirs = new Set();
const removeGeneratedPluginArtifacts = (distPluginDir) => {
removeFileIfExists(path.join(distPluginDir, "openclaw.plugin.json"));
removeFileIfExists(path.join(distPluginDir, "package.json"));
removePathIfExists(path.join(distPluginDir, GENERATED_BUNDLED_SKILLS_DIR));
removePathIfExists(path.join(distPluginDir, "node_modules"));
};
for (const dirent of fs.readdirSync(extensionsRoot, { withFileTypes: true })) {
if (!dirent.isDirectory()) {
@@ -123,8 +129,7 @@ export function copyBundledPluginMetadata(params = {}) {
const distManifestPath = path.join(distPluginDir, "openclaw.plugin.json");
const distPackageJsonPath = path.join(distPluginDir, "package.json");
if (!fs.existsSync(manifestPath)) {
removeFileIfExists(distManifestPath);
removeFileIfExists(distPackageJsonPath);
removeGeneratedPluginArtifacts(distPluginDir);
continue;
}
@@ -165,8 +170,7 @@ export function copyBundledPluginMetadata(params = {}) {
continue;
}
const distPluginDir = path.join(distExtensionsRoot, dirent.name);
removeFileIfExists(path.join(distPluginDir, "openclaw.plugin.json"));
removeFileIfExists(path.join(distPluginDir, "package.json"));
removeGeneratedPluginArtifacts(distPluginDir);
}
}