diff --git a/scripts/routes.ts b/scripts/routes.ts index 8f3c1b8..684ff7c 100644 --- a/scripts/routes.ts +++ b/scripts/routes.ts @@ -1,7 +1,11 @@ -import { join, relative, ensureFileSync } from "../deps.ts"; - +import { join, relative, ensureFileSync, wait, S3 } from "../deps.ts"; const ROUTES_FILE = "routes.generated.ts"; +const S3inner = wait({ + text: `Generating ${ROUTES_FILE}...`, + spinner: "aesthetic" +}) + interface PageRoute { path: string; route: string; @@ -40,6 +44,7 @@ async function readDir(dir: URL): Promise { else finalRoute = replaced.replace('/index', '/') + S3inner.text = `Added ${finalRoute}` routes.push({ route: finalRoute, @@ -83,14 +88,15 @@ async function write(folderwithroutes: string | URL, file: string | URL) { if (import.meta.main) { - console.log(`Writing ${ROUTES_FILE}`) + try { ensureFileSync(`./src/${ROUTES_FILE}`) await write('../src/routes', ROUTES_FILE) } catch (error) { console.error(error) + S3inner.fail() Deno.exit(1) } - console.log(`File written.`) + S3inner.succeed("Routes generated.") Deno.exit(0) } \ No newline at end of file diff --git a/src/static/uwu.txt b/src/static/uwu.txt deleted file mode 100644 index 2e65efe..0000000 --- a/src/static/uwu.txt +++ /dev/null @@ -1 +0,0 @@ -a \ No newline at end of file