MCPcopy Index your code
hub / github.com/commitizen/cz-cli / keep

Function keep

test/tools/clean.js:111–116  ·  view source on GitHub ↗

* Given a reverse chronological array of paths * This deletes all files except for n of them * * n is the (1 indexed) count of files to keep.

(basePath, paths, n)

Source from the content-addressed store, hash-verified

109 * n is the (1 indexed) count of files to keep.
110 */
111function keep (basePath, paths, n) {
112
113 for (let i = paths.length; i > n; i--) {
114 fs.removeSync(path.resolve(basePath, paths[i - 1]));
115 }
116}
117
118function cleanPath (tmpPath) {
119 fs.removeSync(tmpPath);

Callers 1

cleanFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected