(pluginPath)
| 70 | } |
| 71 | |
| 72 | function cleanPlugin(pluginPath) { |
| 73 | const manifestUpdated = restoreManifestFromMaterializedFiles(pluginPath); |
| 74 | if (manifestUpdated) { |
| 75 | console.log(` Updated ${path.basename(pluginPath)}/.github/plugin/plugin.json`); |
| 76 | } |
| 77 | |
| 78 | let removed = 0; |
| 79 | for (const { path: subdir } of Object.values(MATERIALIZED_SPECS)) { |
| 80 | const target = path.join(pluginPath, subdir); |
| 81 | if (fs.existsSync(target) && fs.statSync(target).isDirectory()) { |
| 82 | const count = countFiles(target); |
| 83 | fs.rmSync(target, { recursive: true, force: true }); |
| 84 | removed += count; |
| 85 | console.log(` Removed ${path.basename(pluginPath)}/${subdir}/ (${count} files)`); |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | return { removed, manifestUpdated }; |
| 90 | } |
| 91 | |
| 92 | function countFiles(dir) { |
| 93 | let count = 0; |
no test coverage detected