feat(init): task to generate manifest file (#1422)

This commit is contained in:
Reed von Redwitz
2023-12-05 15:03:37 +01:00
committed by GitHub
parent 60b2198d13
commit 7465dbd978
3 changed files with 84 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
import { join, toFileUrl } from "./deps.ts";
import { manifest } from "./mod.ts";
import { type FreshConfig } from "../server/mod.ts";
const args = Deno.args;
switch (args[0]) {
case "manifest": {
if (args[1]) {
const CONFIG_TS_PATH = join(args[1], "fresh.config.ts");
const url = toFileUrl(CONFIG_TS_PATH).toString();
const config: FreshConfig = (await import(url)).default;
await manifest(args[1], config?.router?.ignoreFilePattern);
} else {
console.error("Missing input for manifest command");
Deno.exit(1);
}
break;
}
default: {
console.error("Invalid command");
Deno.exit(1);
}
}