Skip to content

Commit

Permalink
fix: remove tmp dir to clone
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Dec 6, 2022
1 parent 4c7590a commit 020e0b0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/loader.ts
@@ -1,4 +1,5 @@
import { existsSync } from "node:fs";
import { rmdir } from "node:fs/promises";
import { homedir } from "node:os";
import { resolve, extname, dirname } from "pathe";
import createJiti, { JITI } from "jiti";
Expand Down Expand Up @@ -201,6 +202,9 @@ async function resolveConfig (source: string, options: LoadConfigOptions): Promi
const tmpDir = process.env.XDG_CACHE_HOME
? resolve(process.env.XDG_CACHE_HOME, "c12", name)
: resolve(homedir(), ".cache/c12", name);
if (existsSync(tmpDir)) {
await rmdir(tmpDir, { recursive: true });
}
const clonned = await downloadTemplate(source, { dir: tmpDir });
source = clonned.dir;
}
Expand Down

0 comments on commit 020e0b0

Please sign in to comment.