Skip to content

Commit 6297f7a

Browse files
Don't remove a non-existent directory
1 parent c39e731 commit 6297f7a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

main.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,11 @@ const cloneRegistry = async () => {
4444
const name = meta.name || registry.split("/")[1];
4545
const depot = process.env.JULIA_DEPOT_PATH || path.join(home, ".julia");
4646
const dest = path.join(depot, "registries", name);
47-
if (!fs.existsSync(dest)) {
47+
if (fs.existsSync(dest)) {
48+
tmpdirCleanup();
49+
} else {
4850
fs.moveSync(tmpdir, dest);
4951
}
50-
tmpdirCleanup();
5152
const general = path.join(depot, "registries", "General");
5253
if (!fs.existsSync(general)) {
5354
await exec.exec(`git clone git@github.com:JuliaRegistries/General.git ${general}`);

0 commit comments

Comments
 (0)