We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 86a4bd3 commit 4da1ee9Copy full SHA for 4da1ee9
src/license-plugin.js
@@ -191,7 +191,8 @@ class LicensePlugin {
191
const absolutePath = path.join(dir, '[lL][iI][cC][eE][nN][cCsS][eE]*');
192
const relativeToCwd = path.relative(cwd, absolutePath);
193
const licenseFile = this._findGlob(relativeToCwd, cwd)[0];
194
- if (licenseFile) {
+ // Add the license text if a license file exists
195
+ if (fs.existsSync(licenseFile) && fs.lstatSync(licenseFile).isFile()) {
196
pkg.licenseText = fs.readFileSync(licenseFile, 'utf-8');
197
}
198
0 commit comments