Skip to content

Commit

Permalink
fix: preserve cloned dir if install option provided
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Dec 30, 2023
1 parent deb3cbc commit 81e2891
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/loader.ts
Expand Up @@ -274,12 +274,13 @@ async function resolveConfig<
: resolve(homedir(), ".cache/c12", cloneName);
}

if (existsSync(cloneDir)) {
if (existsSync(cloneDir) && !sourceOptions.install) {
await rm(cloneDir, { recursive: true });
}
const cloned = await downloadTemplate(source, {
dir: cloneDir,
install: sourceOptions.install,
force: sourceOptions.install,
...options.giget,
...sourceOptions.giget,
});
Expand Down

0 comments on commit 81e2891

Please sign in to comment.