wip: watch select .git files in watcher

This commit is contained in:
Adam
2025-09-25 06:38:59 -05:00
parent cd655177d9
commit 945de4eddc
3 changed files with 5 additions and 5 deletions

View File

@@ -6,9 +6,6 @@ export namespace FileIgnore {
"**/.pnpm-store/**",
"**/vendor/**",
// vcs
"**/.git/**",
// Build outputs
"**/dist/**",
"**/build/**",
@@ -50,8 +47,12 @@ export namespace FileIgnore {
filepath: string,
opts: {
extra?: Bun.Glob[]
whitelist?: Bun.Glob[]
},
) {
for (const glob of opts.whitelist || []) {
if (glob.match(filepath)) return false
}
const extra = opts.extra || []
for (const glob of [...GLOBS, ...extra]) {
if (glob.match(filepath)) return true

View File

@@ -30,6 +30,7 @@ export namespace FileWatcher {
ignoreInitial: true,
ignored: (filepath) => {
return FileIgnore.match(filepath, {
whitelist: [new Bun.Glob("**/.git/{index,logs/HEAD}")],
extra: ignore,
})
},