#653 - Update Astro script

This commit is contained in:
Elio Struyf
2023-10-06 16:38:57 +02:00
parent 2423b7351d
commit f1d613274d
3 changed files with 17 additions and 7 deletions
@@ -1,3 +1,5 @@
import { writeFileSync } from "fs";
import { join } from "path";
import { createServer } from "vite";
import zod from "zod";
@@ -206,7 +208,9 @@ const astroContentModulePlugin = () => {
const collections = Object.entries(contentModule.collections ?? {});
const processedCollections = processCollection(collections);
console.log(JSON.stringify(processedCollections));
writeFileSync(join(process.cwd(), `./.frontmatter/temp/astro.collections.json`), JSON.stringify(processedCollections));
console.log("Collections generated successfully");
process.exit(0);
} catch (error) {
console.log(error.message);