()
| 12 | const execPromise = util.promisify(child_process.exec); |
| 13 | |
| 14 | async 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 |
| 29 | export async function checkIfRipgrepIsInstalled(): Promise<boolean> { |
no test coverage detected