Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/util/fs-normalized.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@ export const unlink: (path: string) => Promise<void> = promisify(require('rimraf
* to force the correct naming when the filename has changed only in character-casing. (Jest -> jest).
*/
export const copyFile = async function(data: CopyFileAction, cleanup: () => mixed): Promise<void> {
// $FlowFixMe: Flow doesn't currently support COPYFILE_FICLONE
const ficloneFlag = fs.constants.COPYFILE_FICLONE || 0;
try {
await unlink(data.dest);
await copyFilePoly(data.src, data.dest, 0, data);
await copyFilePoly(data.src, data.dest, ficloneFlag, data);
} finally {
if (cleanup) {
cleanup();
Expand Down