Skip to content

Commit

Permalink
Ignore .git folder when analysing multiple folders
Browse files Browse the repository at this point in the history
Resolves #25
  • Loading branch information
Nixinova committed Jul 1, 2023
1 parent 798602e commit 5fbe780
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## Next
- Fixed the `.git` folder not being ignored when analysing multiple folders ([#25](https://github.com/Nixinova/LinguistJS/issues/25)).

## 2.6.0
*2023-06-29*
- Add `alternatives` key to list all possible alternative language classifications for files that do not have a definite match ([#15](https://github.com/Nixinova/LinguistJS/issues/15), [#19](https://github.com/Nixinova/LinguistJS/pull/19)).
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ async function analyse(input?: string | string[], opts: T.Options = {}): Promise
// Prepare list of ignored files
const gitignores = ignore();
const regexIgnores: RegExp[] = [];
gitignores.add('/.git');
gitignores.add('.git');
if (!opts.keepVendored) regexIgnores.push(...vendorPaths.map(path => RegExp(path, 'i')));
if (opts.ignoredFiles) gitignores.add(opts.ignoredFiles);

Expand Down

0 comments on commit 5fbe780

Please sign in to comment.