MCPcopy Create free account
hub / github.com/continuedev/continue / getGitignorePatterns

Function getGitignorePatterns

extensions/cli/src/tools/searchCode.ts:14–26  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

12const execPromise = util.promisify(child_process.exec);
13
14async function getGitignorePatterns() {
15 const gitIgnorePath = await findUp(".gitignore");
16 if (!gitIgnorePath) return [];
17 const content = fs.readFileSync(gitIgnorePath, "utf-8");
18 const ignorePatterns = [];
19 for (let line of content.trim().split("\n")) {
20 line = line.trim();
21 if (line.startsWith("#") || line === "") continue; // ignore comments and empty line
22 if (line.startsWith("!")) continue; // ignore negated ignores
23 ignorePatterns.push(line);
24 }
25 return ignorePatterns;
26}
27
28// procedure 1: search with ripgrep
29export async function checkIfRipgrepIsInstalled(): Promise<boolean> {

Callers 2

searchWithRipgrepFunction · 0.85
searchWithGrepOrFindstrFunction · 0.85

Calls 1

pushMethod · 0.65

Tested by

no test coverage detected