Files
astro-website/site/scripts/verify-blog-build.ts
Santhosh Janardhanan c773affbc8
Some checks failed
ci / site (push) Has been cancelled
Wordpress is in
2026-02-10 01:04:12 -05:00

28 lines
718 B
TypeScript

import { access, readFile } from "node:fs/promises";
import path from "node:path";
import { readContentCache } from "../src/lib/content/cache";
async function main() {
const distPath = path.join(process.cwd(), "dist", "blog", "index.html");
await access(distPath);
const html = await readFile(distPath, "utf8");
const cache = await readContentCache();
const posts = cache.wordpress?.posts || [];
if (posts.length === 0) {
if (!html.includes("No blog posts yet.")) {
throw new Error("Expected /blog empty state to be present when no WordPress posts exist.");
}
}
}
main().catch((e) => {
// eslint-disable-next-line no-console
console.error(String(e));
process.exitCode = 1;
});