initial commit
This commit is contained in:
commit
3d733cfe0b
11 changed files with 685 additions and 0 deletions
29
scripts/copyright.ts
Executable file
29
scripts/copyright.ts
Executable file
|
|
@ -0,0 +1,29 @@
|
|||
#!/usr/bin/env -S deno run --allow-read --allow-write
|
||||
/**
|
||||
* Copyright (c) 2025 favewa
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
import { walk } from "https://deno.land/std/fs/walk.ts";
|
||||
|
||||
const copyrightHeader = `/**
|
||||
* Copyright (c) 2025 favewa
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
`;
|
||||
|
||||
const dir = "./";
|
||||
|
||||
for await (const entry of walk(dir, {
|
||||
exts: [".ts", ".tsx"],
|
||||
includeDirs: false,
|
||||
skip: [/node_modules/, /copyright\.ts$/],
|
||||
})) {
|
||||
const filePath = entry.path;
|
||||
const content = await Deno.readTextFile(filePath);
|
||||
|
||||
if (!content.startsWith(copyrightHeader)) {
|
||||
await Deno.writeTextFile(filePath, copyrightHeader + "\n" + content);
|
||||
console.log(`Added header to ${filePath}`);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue