Skip to content

Commit c848319

Browse files
committed
fix(scan): refine skip directory path matching
1 parent ec0266f commit c848319

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

index.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -684,9 +684,6 @@ class BunKill {
684684
private shouldSkipDirectory(dirPath: string): boolean {
685685
const absoluteSkipRoots = [
686686
"/System",
687-
"/Library/Application Support",
688-
"/Library/Frameworks",
689-
"/Applications",
690687
"/private",
691688
"/dev",
692689
"/proc",
@@ -707,6 +704,12 @@ class BunKill {
707704
"/usr/local/sbin",
708705
];
709706

707+
const pathContainsSkipPatterns = [
708+
"/Library/Application Support",
709+
"/Library/Frameworks",
710+
"/Applications",
711+
];
712+
710713
const nameSkipPatterns = [
711714
".photolibrary",
712715
".photoslibrary",
@@ -757,6 +760,14 @@ class BunKill {
757760
return true;
758761
}
759762

763+
if (
764+
pathContainsSkipPatterns.some((pattern) =>
765+
normalizedPath.includes(pattern.toLowerCase())
766+
)
767+
) {
768+
return true;
769+
}
770+
760771
return nameSkipPatterns.some((pattern) =>
761772
normalizedPath.includes(pattern.toLowerCase())
762773
);

0 commit comments

Comments
 (0)