Skip to content

Commit

Permalink
fix: remove unsafe remove of install folder
Browse files Browse the repository at this point in the history
  • Loading branch information
merceyz committed Feb 3, 2024
1 parent b9eea58 commit 5f7b1c1
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions sources/corepackUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,14 +172,6 @@ export async function installVersion(installTarget: string, locator: Locator, {s
hash: serializedHash,
}));

// The target folder may exist if a previous version of Corepack installed
// it but didn't create the `.corepack` file. In this case we need to
// remove it first.
await fs.promises.rm(installFolder, {
recursive: true,
force: true,
});

await fs.promises.mkdir(path.dirname(installFolder), {recursive: true});
try {
await fs.promises.rename(tmpFolder, installFolder);
Expand Down

0 comments on commit 5f7b1c1

Please sign in to comment.