i love deno-fmt
This commit is contained in:
parent
5197e3316d
commit
995161f491
9 changed files with 435 additions and 430 deletions
|
|
@ -15,17 +15,17 @@ const copyrightHeader = `/**
|
|||
const dir = "./";
|
||||
|
||||
for await (
|
||||
const entry of walk(dir, {
|
||||
exts: [".ts", ".tsx"],
|
||||
includeDirs: false,
|
||||
skip: [/node_modules/, /copyright\.ts$/],
|
||||
})
|
||||
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);
|
||||
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}`);
|
||||
}
|
||||
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