MCPcopy Index your code
hub / github.com/remix-run/react-router / deleteChangeFiles

Function deleteChangeFiles

scripts/changes/version.ts:247–272  ·  view source on GitHub ↗

* Deletes all change files (except README.md)

(packageDirName: string)

Source from the content-addressed store, hash-verified

245 * Deletes all change files (except README.md)
246 */
247function deleteChangeFiles(packageDirName: string) {
248 let changesDir = path.join(getPackagePath(packageDirName), ".changes");
249 let changeFiles = fs
250 .readdirSync(changesDir)
251 .filter((file) => file !== "README.md" && file.endsWith(".md"));
252
253 if (preview) {
254 if (changeFiles.length === 0) {
255 console.log(` • No change files to delete`);
256 } else {
257 console.log(
258 ` • Would delete ${changeFiles.length} change file${changeFiles.length === 1 ? "" : "s"}:`,
259 );
260 console.log(changeFiles.map((f) => ` - ${f}`).join("\n"));
261 }
262 return;
263 }
264
265 for (let file of changeFiles) {
266 fs.unlinkSync(path.join(changesDir, file));
267 }
268
269 console.log(
270 ` ✓ Deleted ${changeFiles.length} change file${changeFiles.length === 1 ? "" : "s"}`,
271 );
272}
273
274/**
275 * Regenerates the Table of Contents in the root CHANGELOG.md.

Callers 1

version.tsFile · 0.85

Calls 2

getPackagePathFunction · 0.90
logMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…