microsoft / license-checker-webpack-plugin

Webpack plugin that verifies licenses of all external dependencies in a compilation, and outputs them to a file.
MIT License
135 stars 28 forks source link

Prevent license glob from capturing directories #18

Closed rcooney closed 4 years ago

rcooney commented 4 years ago

If a dependencyPath contains a directory that matches the licenseGlob the getLicenseContents method attempts to read the file content of the directory. This fails with the following error:

Error: EISDIR: illegal operation on a directory, read
    at Object.readSync (fs.js:524:3)
    at tryReadSync (fs.js:349:20)
    at readFileSync (fs.js:386:19)
    at getLicenseContents (C:\...\node_modules\license-checker-webpack-plugin\src\licenseUtils.js:19:30)

The proposed change excludes directories from the glob.

unindented commented 4 years ago

Ah, nice catch! Thank you for this!

rcooney commented 4 years ago

@unindented Thanks for including it! I'm not sure if this is the right place to ask, but can the 0.1.5 release be pushed to npm?

unindented commented 4 years ago

@rcooney oops, sorry about that. I just published 0.1.5.