diff --git a/.changeset/unlucky-rats-unite.md b/.changeset/unlucky-rats-unite.md new file mode 100644 index 00000000..cc4b3d59 --- /dev/null +++ b/.changeset/unlucky-rats-unite.md @@ -0,0 +1,5 @@ +--- +"counterfact": patch +--- + +delete the .cache directory at startup so old leftover files don't make trouble diff --git a/src/server/app.ts b/src/server/app.ts index 7817f867..4a4359f0 100644 --- a/src/server/app.ts +++ b/src/server/app.ts @@ -1,3 +1,4 @@ +import { rm } from "node:fs/promises"; import nodePath from "node:path"; import { createHttpTerminator, type HttpTerminator } from "http-terminator"; @@ -37,6 +38,8 @@ export async function counterfact(config: Config) { .join(modulesPath, ".cache") .replaceAll("\\", "/"); + await rm(compiledPathsDirectory, { force: true, recursive: true }); + const registry = new Registry(); const contextRegistry = new ContextRegistry();