Remove cp-file, use copyFileSync instead

This commit is contained in:
Feross Aboukhadijeh
2019-09-14 16:05:52 -07:00
parent 54b1832007
commit e72005e239
5 changed files with 68 additions and 160 deletions

View File

@@ -1,5 +1,5 @@
const Application = require('spectron').Application
const cpFile = require('cp-file')
const { copyFileSync } = require('fs')
const fs = require('fs')
const mkdirp = require('mkdirp')
const parseTorrent = require('parse-torrent')
@@ -221,7 +221,7 @@ function extractImportantFields (parsedTorrent) {
function copy (pathFrom, pathTo) {
try {
cpFile.sync(pathFrom, pathTo)
copyFileSync(pathFrom, pathTo)
} catch (err) {
// Windows lets us create files and folders under C:\Windows\Temp,
// but when you try to `copySync` into one of those folders, you get EPERM