Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Trust the filesystem to move files
The original lib/util/move-file.js has gone through many iterations over the last several years. It no longer represents anything close to the original intent. Most of the functionality it was originally trying to work around is now something that `@npmcli/fs#moveFile` does, and better. Trying to move a file by creating a hard link and unlinking the old file is an optimization best left to the operating system when you ask it to move a file. In fact the `@npmcli/fs#moveFile` method tries a *rename* first, which is the best choice all around. It also supports an "overwrite: false" flag so we can still error out if the destination already exists. This PR removes all of the old legacy code.
- Loading branch information
Showing
4 changed files
with
25 additions
and
261 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.