MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / deleteRedundantFiles

Function deleteRedundantFiles

src/lib/installPlugin.js:517–527  ·  view source on GitHub ↗

* * @param {Record } files

(pluginDir, state)

Source from the content-addressed store, hash-verified

515 * @param {Record<string, boolean>} files
516 */
517async function deleteRedundantFiles(pluginDir, state) {
518 /** @type {string[]} */
519 let files = [];
520 await listFileRecursive(pluginDir, files);
521
522 for (const file of files) {
523 if (!state.exists(file.replace(`${pluginDir}/`, ""))) {
524 fsOperation(file).delete();
525 }
526 }
527}

Callers 1

installPluginFunction · 0.85

Calls 4

listFileRecursiveFunction · 0.85
fsOperationFunction · 0.85
existsMethod · 0.65
deleteMethod · 0.65

Tested by

no test coverage detected