Skip to content

Commit

Permalink
chore: use renameSafe where applicable (#515)
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtekmaj authored Jul 12, 2024
1 parent d3d7780 commit 4f3e28f
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions sources/corepackUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -307,11 +307,7 @@ export async function installVersion(installTarget: string, locator: Locator, {s

await fs.promises.mkdir(path.dirname(installFolder), {recursive: true});
try {
if (process.platform === `win32`) {
await renameUnderWindows(tmpFolder, installFolder);
} else {
await fs.promises.rename(tmpFolder, installFolder);
}
await renameSafe(tmpFolder, installFolder);
} catch (err) {
if (
(err as nodeUtils.NodeError).code === `ENOTEMPTY` ||
Expand Down

0 comments on commit 4f3e28f

Please sign in to comment.