(realCwd: string)
| 407 | } |
| 408 | |
| 409 | protected async matcher(realCwd: string): Promise<Ignore | undefined> { |
| 410 | const cached = this.gitignoreCache.get(realCwd); |
| 411 | if (cached !== undefined) return cached; |
| 412 | const ig = ignore(); |
| 413 | |
| 414 | ig.add('.git/'); |
| 415 | try { |
| 416 | const contents = await fs.readFile(path.join(realCwd, '.gitignore'), 'utf-8'); |
| 417 | ig.add(contents); |
| 418 | } catch { |
| 419 | |
| 420 | } |
| 421 | this.gitignoreCache.set(realCwd, ig); |
| 422 | return ig; |
| 423 | } |
| 424 | } |
| 425 | |
| 426 | function isHidden(name: string): boolean { |