SPB Git
817 B · 10 lines typescript
1import "./_env";2import { importAll } from "../src/lib/content/import";3import { closeDb } from "../src/db";4import { join } from "node:path";5const args = process.argv.slice(2);6const root = join(import.meta.dirname, "..", "content");7const report = await importAll({ root, publish: args.includes("--publish"), dryRun: args.includes("--dry-run"), force: args.includes("--force"), actor: process.env.IMPORT_ACTOR ?? "content-import", only: args.filter((a) => !a.startsWith("--")).length ? args.filter((a) => !a.startsWith("--")) : undefined });8console.log(JSON.stringify({ ...report, tools: { created: report.tools.created.length, updated: report.tools.updated.length, unchanged: report.tools.unchanged.length, published: report.tools.published.length, skipped: report.tools.skipped } }, null, 2));9await closeDb();10
Files · ba7bd272caa00f8811bdea5814fbf1150547c055
Menu

Theme