Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: licensefile glob on windows #931

Merged
merged 1 commit into from
Oct 6, 2021

Conversation

codepunkt
Copy link
Contributor

I'm the maintainer of webpack-license-plugin, so I have quite extensive experience with license compliance and reaching it with JavaScript build tools.

I was having the problem that your plugin didn't find any licenseTexts, even though the /LICEN[CS]E/i files were in the appropriate node_modules subdirectories. Turns out this is a problem that the glob library has had on windows (turns out, even on WSL for windows, which I'm using) for years when you use it with the nocase option.

To fix this, I removed the nocase option and instead adjusted the glob pattern from LICENSE* to [lL][iI][cC][eE][nN][sS][eE]*. It's not nice, but it circumvents any problems finding these files on windows.

Because of my experience with the webpack plugin linked above, I also know that a few projects name their files LICENCE instead of LICENSE, so i included this option in the new glob pattern, making it [lL][iI][cC][eE][nN][cCsS][eE]*.

@mjeanroy
Copy link
Owner

mjeanroy commented Oct 6, 2021

Awesome, thanks!

I encountered the glob issue in this PR, I thought I fixed it, but your solution looks great!

@mjeanroy mjeanroy merged commit 769ede5 into mjeanroy:master Oct 6, 2021
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants