Skip to content

Commit

Permalink
Merge pull request #882 from pmcelhaney/clear-cache
Browse files Browse the repository at this point in the history
delete the .cache directory at startup
  • Loading branch information
pmcelhaney authored May 1, 2024
2 parents 22ab74b + a5a728a commit 41d4e1e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/unlucky-rats-unite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"counterfact": patch
---

delete the .cache directory at startup so old leftover files don't make trouble
3 changes: 3 additions & 0 deletions src/server/app.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { rm } from "node:fs/promises";
import nodePath from "node:path";

import { createHttpTerminator, type HttpTerminator } from "http-terminator";
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 41d4e1e

Please sign in to comment.