MCPcopy Index your code
hub / github.com/EvoMap/evolver / _commitAtomicFileReplacement

Function _commitAtomicFileReplacement

src/forceUpdate.js:459–467  ·  view source on GitHub ↗
(srcPath, dstPath, tmpPath, backupPath)

Source from the content-addressed store, hash-verified

457}
458
459function _commitAtomicFileReplacement(srcPath, dstPath, tmpPath, backupPath) {
460 try { fs.rmSync(tmpPath, { force: true }); } catch (_) {}
461 try { fs.rmSync(backupPath, { force: true }); } catch (_) {}
462 fs.copyFileSync(srcPath, tmpPath);
463 _copyFileIfPresent(dstPath, backupPath);
464 _retryFsLockOperation(function () {
465 fs.renameSync(tmpPath, dstPath);
466 });
467}
468
469function _restoreMovedInstallEntries(installRoot, movedEntries, copiedEntryNames) {
470 var ok = true;

Callers 1

_installDownloadedTreeFunction · 0.85

Calls 2

_copyFileIfPresentFunction · 0.85
_retryFsLockOperationFunction · 0.85

Tested by

no test coverage detected