@@ -16,7 +16,6 @@ import tempDir from 'temp-dir'
1616import { promisify } from 'util'
1717import plusxSync from './chmod'
1818import { cleanupCache } from './cleanupCache'
19- import { copy } from './copy'
2019import { downloadZip } from './downloadZip'
2120import { flatMap } from './flatMap'
2221import { getHash } from './getHash'
@@ -28,6 +27,7 @@ const debug = Debug('prisma:download')
2827const writeFile = promisify ( fs . writeFile )
2928const exists = promisify ( fs . exists )
3029const readFile = promisify ( fs . readFile )
30+ const copyFile = promisify ( fs . copyFile )
3131
3232const channel = 'master'
3333export enum EngineTypes {
@@ -290,14 +290,14 @@ async function binaryNeedsToBeDownloaded(
290290 if ( sha256File === sha256Cache ) {
291291 if ( ! targetExists ) {
292292 debug ( `copying ${ cachedFile } to ${ job . targetFilePath } ` )
293- await copy ( cachedFile , job . targetFilePath )
293+ await copyFile ( cachedFile , job . targetFilePath )
294294 }
295295 const targetSha256 = await getHash ( job . targetFilePath )
296296 if ( sha256File !== targetSha256 ) {
297297 debug (
298298 `overwriting ${ job . targetFilePath } with ${ cachedFile } as hashes do not match` ,
299299 )
300- await copy ( cachedFile , job . targetFilePath )
300+ await copyFile ( cachedFile , job . targetFilePath )
301301 }
302302 return false
303303 } else {
@@ -492,7 +492,7 @@ async function saveFileToCache(
492492 )
493493
494494 try {
495- await copy ( job . targetFilePath , cachedTargetPath )
495+ await copyFile ( job . targetFilePath , cachedTargetPath )
496496 await writeFile ( cachedSha256Path , sha256 )
497497 await writeFile ( cachedSha256ZippedPath , zippedSha256 )
498498 } catch ( e ) {
0 commit comments