Skip to content

Commit

Permalink
Ignore .git along with git-ignored files
Browse files Browse the repository at this point in the history
  • Loading branch information
illright committed Dec 27, 2024
1 parent d79842e commit e0e6f05
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export async function chooseFromSimilar(input: string): Promise<string> {
const existingDir = await resolveWithCorrections(dir || '.')

const candidates = (await readdir(existingDir, { withFileTypes: true }))
.filter((entry) => entry.isDirectory() && !isIgnored(join(existingDir, entry.name)))
.filter((entry) => entry.isDirectory() && entry.name !== '.git' && !isIgnored(join(existingDir, entry.name)))
.map((entry) => entry.name)
const withDistances = candidates.map((candidate) => [candidate, distance(candidate, base)] as const)
const suggestions = withDistances
Expand Down
2 changes: 1 addition & 1 deletion packages/steiger/src/features/transfer-fs-to-vfs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export async function createWatcher(path: string) {
const isIgnored = await isGitIgnored({ cwd: find.up('.git', { cwd: path }) ?? path })

const watcher = chokidar.watch(path, {
ignored: (path) => path.split(sep).includes('node_modules') || isIgnored(path),
ignored: (path) => path.split(sep).includes('node_modules') || path.split(sep).includes('.git') || isIgnored(path),
ignoreInitial: false,
alwaysStat: true,
awaitWriteFinish: true,
Expand Down

0 comments on commit e0e6f05

Please sign in to comment.