Skip to content

Commit 84a678a

Browse files
committed
Ignore lock files during file search by term
1 parent 751b069 commit 84a678a

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

apps/editor/src/commands/search-files-for-context-command/utils/search-files-by-term.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ import * as fs from 'fs'
33
import { Logger } from '@shared/utils/logger'
44
import { create_search_regex } from './create-search-regex'
55

6+
const IGNORED_FILES = new Set([
7+
'pnpm-lock.yaml',
8+
'package-lock.json',
9+
'yarn.lock'
10+
])
11+
612
export const search_files_by_term = async (params: {
713
files: string[]
814
search_term: string
@@ -14,6 +20,10 @@ export const search_files_by_term = async (params: {
1420
try {
1521
const file_name = path.basename(file_path)
1622

23+
if (IGNORED_FILES.has(file_name)) {
24+
continue
25+
}
26+
1727
if (regex.test(file_name)) {
1828
matched_files.push(file_path)
1929
continue

0 commit comments

Comments
 (0)