Skip to content

Commit

Permalink
Check that license file is actually a file (#1231)
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Kowal <michael.kowal@vertigis.com>
  • Loading branch information
MichaelKowal and Michael Kowal committed Oct 16, 2022
1 parent 86a4bd3 commit 4da1ee9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/license-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,8 @@ class LicensePlugin {
const absolutePath = path.join(dir, '[lL][iI][cC][eE][nN][cCsS][eE]*');
const relativeToCwd = path.relative(cwd, absolutePath);
const licenseFile = this._findGlob(relativeToCwd, cwd)[0];
if (licenseFile) {
// Add the license text if a license file exists
if (fs.existsSync(licenseFile) && fs.lstatSync(licenseFile).isFile()) {
pkg.licenseText = fs.readFileSync(licenseFile, 'utf-8');
}

Expand Down

0 comments on commit 4da1ee9

Please sign in to comment.