Node's implementation of renameSync automatically overwrites files, but in this implementation we throw an error if there is already a file at the destination path.
Currently, I'm having to use existsSync -> renameSync to avoid the error. This adds an extra call to the file system would be nice to avoid if possible.
Problem
Node's implementation of
renameSync
automatically overwrites files, but in this implementation we throw an error if there is already a file at the destination path.Possible Solution
Rather than using
moveItemAtPath
we can instead usereplaceItemAtURL
to achieve this desired behavior.Stop Gap
Currently, I'm having to use
existsSync
->renameSync
to avoid the error. This adds an extra call to the file system would be nice to avoid if possible.