Skip to content

Commit

Permalink
Check for word boundaries around the word 'license' or 'licence' when…
Browse files Browse the repository at this point in the history
… looking for potential license files in project directories

This is an alternative implementation of commit b673731.
  • Loading branch information
jayaddison committed Jan 9, 2023
1 parent 2da3200 commit 1ea317b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/LicenseTextReader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class LicenseTextReader {
if (this.fileSystem.isDirectory(filePath)) {
continue;
}
if (/^licen[cs]e/i.test(path)) {
if (/^licen[cs]e/i.test(path) || /\blicen[cs]e\b/i.test(path)) {
return path;
}
}
Expand Down

0 comments on commit 1ea317b

Please sign in to comment.