diff --git a/services/clsi/app/js/UrlCache.js b/services/clsi/app/js/UrlCache.js index 90c6486f98..23afafaaa8 100644 --- a/services/clsi/app/js/UrlCache.js +++ b/services/clsi/app/js/UrlCache.js @@ -19,7 +19,6 @@ const UrlFetcher = require('./UrlFetcher') const Settings = require('settings-sharelatex') const crypto = require('crypto') const fs = require('fs') -const fse = require('fs-extra') const logger = require('logger-sharelatex') const async = require('async') @@ -36,7 +35,7 @@ module.exports = UrlCache = { if (error != null) { return callback(error) } - return fse.copy(pathToCachedUrl, destPath, function (error) { + return fs.copyFile(pathToCachedUrl, destPath, function (error) { if (error != null) { logger.error( { err: error, from: pathToCachedUrl, to: destPath }, diff --git a/services/clsi/test/unit/js/UrlCacheTests.js b/services/clsi/test/unit/js/UrlCacheTests.js index 7276b1325d..40652c5899 100644 --- a/services/clsi/test/unit/js/UrlCacheTests.js +++ b/services/clsi/test/unit/js/UrlCacheTests.js @@ -27,8 +27,7 @@ describe('UrlCache', function () { 'settings-sharelatex': (this.Settings = { path: { clsiCacheDir: '/cache/dir' } }), - fs: (this.fs = {}), - 'fs-extra': (this.fse = { copy: sinon.stub().yields() }) + fs: (this.fs = { copyFile: sinon.stub().yields() }) } })) }) @@ -249,7 +248,6 @@ describe('UrlCache', function () { beforeEach(function () { this.cachePath = 'path/to/cached/url' this.destPath = 'path/to/destination' - this.UrlCache._copyFile = sinon.stub().callsArg(2) this.UrlCache._ensureUrlIsInCache = sinon .stub() .callsArgWith(3, null, this.cachePath) @@ -269,7 +267,7 @@ describe('UrlCache', function () { }) it('should copy the file to the new location', function () { - return this.fse.copy + return this.fs.copyFile .calledWith(this.cachePath, this.destPath) .should.equal(true) })