diff --git a/lib/resource-saver/index.js b/lib/resource-saver/index.js index 11196ac3..1ea09623 100644 --- a/lib/resource-saver/index.js +++ b/lib/resource-saver/index.js @@ -3,10 +3,7 @@ const path = require('path'); const _ = require('lodash'); const Promise = require('bluebird'); - const fs = require('fs-extra'); -const outputFileAsync = Promise.promisify(fs.outputFile); -const removeAsync = Promise.promisify(fs.remove); const supportedOptions = [ 'directory' ]; @@ -35,7 +32,7 @@ class ResourceSaver { saveResource (resource) { const filename = path.join(this.absoluteDirectoryPath, resource.getFilename()); const text = resource.getText(); - return outputFileAsync(filename, text, { encoding: 'binary' }).then(() => { + return fs.outputFile(filename, text, { encoding: 'binary' }).then(() => { this.loadedResources.push(resource); }); } @@ -46,7 +43,7 @@ class ResourceSaver { */ errorCleanup () { if (!_.isEmpty(this.loadedResources)) { - return removeAsync(this.absoluteDirectoryPath); + return fs.remove(this.absoluteDirectoryPath); } return Promise.resolve(); } diff --git a/package.json b/package.json index 7daaf0ff..9b68b878 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "cheerio": "0.22.0", "css-url-parser": "^1.0.0", "debug": "^2.4.5", - "fs-extra": "^2.0.0", + "fs-extra": "^3.0.0", "he": "^1.1.0", "lodash": "^4.11.1", "normalize-url": "^1.5.3",