diff --git a/changelog.md b/changelog.md index 374b72e..4b1586d 100644 --- a/changelog.md +++ b/changelog.md @@ -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)). diff --git a/src/index.ts b/src/index.ts index a8cc2f6..fa160a7 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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);