diff --git a/src/util/fs-normalized.js b/src/util/fs-normalized.js index b9cf7e5d3c..b0dbd76327 100644 --- a/src/util/fs-normalized.js +++ b/src/util/fs-normalized.js @@ -36,9 +36,11 @@ export const unlink: (path: string) => Promise = 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 { + // $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();