From 9fbd8111015a2201a3a2af21d64608351e722cee Mon Sep 17 00:00:00 2001 From: Seth Trowbridge Date: Mon, 6 Nov 2023 17:05:40 -0500 Subject: [PATCH] cirectory cleanup --- cli.tsx | 2 +- deno.jsonc | 1 + run-baker.tsx | 14 +++++++++++--- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/cli.tsx b/cli.tsx index f2ec26d..8619f1a 100644 --- a/cli.tsx +++ b/cli.tsx @@ -129,7 +129,7 @@ if(arg._.length) } case "baker" : { - const args = ["run", `-A`, `--no-lock`, `--config=${config.path}`, RootHost+"run.tsx", ...Deno.args]; + const args = ["run", `-A`, `--no-lock`, `--config=${config.path}`, RootHost+"run-baker.tsx", ...Deno.args]; await SubProcess(args); break; } diff --git a/deno.jsonc b/deno.jsonc index 5c84f45..4b3d16f 100644 --- a/deno.jsonc +++ b/deno.jsonc @@ -15,6 +15,7 @@ "debug": "deno run -A --no-lock http://localhost:4507/cli.tsx debug", "serve": "deno run -A --no-lock http://localhost:4507/cli.tsx serve", "cloud": "deno run -A --no-lock http://localhost:4507/cli.tsx cloud", + "baker": "deno run -A --no-lock http://localhost:4507/cli.tsx baker", "install": "deno install -A -r -f -n able http://localhost:4507/cli.tsx" }, "compilerOptions": { diff --git a/run-baker.tsx b/run-baker.tsx index 65f9846..422c7c8 100644 --- a/run-baker.tsx +++ b/run-baker.tsx @@ -46,10 +46,18 @@ const options:SWCW.Options = { const dir = Deno.cwd(); const folder = dir.substring(dir.lastIndexOf("\\")+1); console.log("searching", dir); -const extensions = ["tsx", "ts", "jsx", "js"] -for await(const file of walk(dir, {includeDirs:false})) +const extensions = ["tsx", "ts", "jsx", "js"]; +try { - + await Deno.remove(".bake", { recursive: true }); + console.log("rebuilding baked files"); +} +catch(e) +{ + console.log("fresh bake"); +} +for await(const file of walk(dir, {includeDirs:false})) +{ const pathClean = file.path.replaceAll("\\", "/"); const pathRel = pathClean.substring(dir.length);