Ignore directories in lint-licenses task

The glob pattern will include directories that have a name ending,
for example, with `.js`.
This commit is contained in:
Nicolò Ribaudo 2026-03-04 16:17:38 +01:00
parent 40bd73551c
commit ad91f3abc8
No known key found for this signature in database
GPG Key ID: AAFDA9101C58F338

View File

@ -2083,11 +2083,16 @@ gulp.task("lint-licenses", function (done) {
"examples/**/*.html",
"!web/wasm/**/*",
],
{
base: ".",
}
{ base: "." }
)
.on("data", function (file) {
if (!file.contents) {
console.warn(
` ${file.relative} is a directory, skipping license header check.`
);
return;
}
const relativePath = file.relative;
const content = file.contents.toString();
const re = relativePath.endsWith(".html") ? htmlRE : jsRE;