From 64428ae76179a2acfa58524a5b08aadf569809c6 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 1 Nov 2025 20:16:59 +0200 Subject: [PATCH] feat(build-docs): clean before building --- apps/build-docs/src/main.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/apps/build-docs/src/main.ts b/apps/build-docs/src/main.ts index be936037f..6ef22cf98 100644 --- a/apps/build-docs/src/main.ts +++ b/apps/build-docs/src/main.ts @@ -1,9 +1,19 @@ import { join } from "path"; import BuildContext from "./context"; import buildSwagger from "./swagger"; +import { mkdirSync, rmSync } from "fs"; const context: BuildContext = { baseDir: join(__dirname, "../../../site") }; -buildSwagger(context); +function main() { + // Clean input dir. + rmSync(context.baseDir, { recursive: true }); + mkdirSync(context.baseDir); + + // Start building. + buildSwagger(context); +} + +main();