-
-
Save oscarotero/c6404f36530cf989ec1ba65b75d41e9c to your computer and use it in GitHub Desktop.
Rename Lume files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { walk } from "https://deno.land/std@0.201.0/fs/mod.ts"; | |
for await (const entry of walk("./tests")) { | |
let { path } = entry; | |
if (path.match(/\.tmpl\.\w+$/)) { | |
if (path.includes("/_includes/") || path.includes("/_components/")) { | |
path = path.replace(/\.tmpl(\.\w+)$/, "$1"); | |
} else { | |
path = path.replace(/\.tmpl(\.\w+)$/, ".page$1"); | |
} | |
await Deno.rename(entry.path, path); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment