license headers

This commit is contained in:
Lucas Nogueira
2023-09-29 09:56:14 -03:00
parent 6940f74acd
commit c34afb7187
15 changed files with 709 additions and 605 deletions
+6 -5
View File
@@ -27,7 +27,7 @@ const ignore = [
async function checkFile(file) {
if (
extensions.some((e) => file.endsWith(e)) &&
!ignore.some((i) => file.endsWith(i))
!ignore.some((i) => file.includes(i))
) {
const fileStream = fs.createReadStream(file);
const rl = readline.createInterface({
@@ -72,8 +72,8 @@ async function check(src) {
const missingHeader = [];
for (const entry of fs.readdirSync(src, {
withFileTypes: true,
})) {
withFileTypes: true,
})) {
const p = path.join(src, entry.name);
if (entry.isSymbolicLink() || ignore.includes(entry.name)) {
@@ -113,7 +113,8 @@ if (files.length > 0) {
run();
} else {
check(path.resolve(new URL(import.meta.url).pathname, "../../..")).then(
check(path.resolve(new URL(
import.meta.url).pathname, "../../..")).then(
(missing) => {
if (missing.length > 0) {
console.log(missing.join("\n"));
@@ -121,4 +122,4 @@ if (files.length > 0) {
}
},
);
}
}