MCPcopy Index your code
hub / github.com/nodejs/corepack / renameSafe

Function renameSafe

sources/corepackUtils.ts:357–363  ·  view source on GitHub ↗
(oldPath: fs.PathLike, newPath: fs.PathLike)

Source from the content-addressed store, hash-verified

355}
356
357async function renameSafe(oldPath: fs.PathLike, newPath: fs.PathLike) {
358 if (process.platform === `win32`) {
359 await renameUnderWindows(oldPath, newPath);
360 } else {
361 await fs.promises.rename(oldPath, newPath);
362 }
363}
364
365async function renameUnderWindows(oldPath: fs.PathLike, newPath: fs.PathLike) {
366 // Windows malicious file analysis blocks files currently under analysis, so we need to wait for file release

Callers 2

downloadFunction · 0.85
installVersionFunction · 0.85

Calls 1

renameUnderWindowsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…