Skip to content

Commit 387b1c5

Browse files
committed
docs(changeset):
1 parent 400625e commit 387b1c5

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

.changeset/brave-mugs-drive.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---

lib/src/utils.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,18 @@ export const listMatchingFiles = async ({
5656
debug,
5757
backupDir = DEFAULT_BACKUP_DIR,
5858
}: CollectFilesOptions): Promise<FileEntry[]> => {
59+
// delete backupDir during initialization
60+
try {
61+
await fs.rm(backupDir, { recursive: true, force: true });
62+
} catch {
63+
// ignore
64+
}
5965
for (const p of [...include, ...exclude]) {
6066
if (p.startsWith("!")) throw new Error(`Negation not allowed in include/exclude: ${p}`);
6167
if (p.includes("\\")) console.warn(`Use '/' as path separator: ${p}`);
6268
}
6369

64-
exclude.push(backupDir);
70+
exclude.push(`${backupDir}/**`);
6571

6672
const fileMatcher = (filepath: string) => {
6773
const posixPath = filepath.replace(/\\/g, "/");

0 commit comments

Comments
 (0)