MCPcopy Create free account
hub / github.com/github/awesome-copilot / cleanPlugin

Function cleanPlugin

eng/clean-materialized-plugins.mjs:72–90  ·  view source on GitHub ↗
(pluginPath)

Source from the content-addressed store, hash-verified

70}
71
72function 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
92function countFiles(dir) {
93 let count = 0;

Callers 1

mainFunction · 0.85

Calls 2

countFilesFunction · 0.85

Tested by

no test coverage detected