diff --git a/lib/cli/utils.js b/lib/cli/utils.js index ddcf3d43..0a1f2926 100755 --- a/lib/cli/utils.js +++ b/lib/cli/utils.js @@ -3,7 +3,6 @@ var chalk = require("chalk"); var fs = require("fs"); var path = require("path"); -var mkdirp = require("mkdirp"); var _ = require("underscore"); module.exports.readFileSafe = function(filename) { @@ -65,19 +64,23 @@ module.exports.readPackageXml = function(packageXmlPath) { }; module.exports.writePackageXml = function(manifest, packageXmlPath, destructive, callback) { - mkdirp(path.dirname(packageXmlPath), function(mkdirErr) { - if (mkdirErr) { - return callback(mkdirErr); - } else { - fs.writeFile(packageXmlPath, manifest.toPackageXml(destructive), function(err) { - if (err) { - return callback(err); - } else { - return callback(null, "Created " + path.relative(process.cwd(), packageXmlPath)); - } - }); - } - }); + fs.mkdir( + path.dirname(packageXmlPath), { + recursive: true + }, + function(mkdirErr) { + if (mkdirErr) { + return callback(mkdirErr); + } else { + fs.writeFile(packageXmlPath, manifest.toPackageXml(destructive), function(err) { + if (err) { + return callback(err); + } else { + return callback(null, "Created " + path.relative(process.cwd(), packageXmlPath)); + } + }); + } + }); }; /** diff --git a/lib/remotes/provider/config.js b/lib/remotes/provider/config.js index 30e68d70..1932e38b 100755 --- a/lib/remotes/provider/config.js +++ b/lib/remotes/provider/config.js @@ -5,7 +5,6 @@ var Remote = require('../remote'); var path = require('path'); var fs = require('fs'); -var mkdirp = require('mkdirp'); var ConfigRemoteProvider = module.exports = function(config) { var self = this; @@ -66,7 +65,9 @@ ConfigRemoteProvider.prototype.remove = function(name, callback) { ConfigRemoteProvider.prototype.save = function(callback) { var self = this; if (!fs.existsSync(path.dirname(self.config.path))) { - mkdirp.sync(path.dirname(self.config.path), parseInt('0700', 8)); + fs.mkdirSync(path.dirname(self.config.path), parseInt('0700', 8), { + recursive: true + }); } fs.writeFile(self.config.path, JSON.stringify({ remotes: self.remotesDict diff --git a/lib/unzip.js b/lib/unzip.js index 14132300..7300e396 100644 --- a/lib/unzip.js +++ b/lib/unzip.js @@ -1,6 +1,5 @@ var yauzl = require('yauzl'); var path = require('path'); -var mkdirp = require("mkdirp"); var fs = require('fs-extra'); var Unzip = module.exports = function(zipFilename) { @@ -34,15 +33,19 @@ Unzip.prototype.target = function(targetDirectory, callback) { } var outputDir = path.join(targetDirectory, path.dirname(entry.fileName)); var outputFile = path.join(targetDirectory, entry.fileName); - mkdirp(outputDir, function(mkdirErr) { - if (mkdirErr) { - return callback(mkdirErr); - } - readStream.pipe(fs.createWriteStream(outputFile)); - readStream.on("end", function() { - zipfile.readEntry(); + fs.mkdir( + outputDir, { + recursive: true + }, + function(mkdirErr) { + if (mkdirErr) { + return callback(mkdirErr); + } + readStream.pipe(fs.createWriteStream(outputFile)); + readStream.on("end", function() { + zipfile.readEntry(); + }); }); - }); }); }); }); diff --git a/package-lock.json b/package-lock.json index c05e1fef..a24e3d00 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2642,7 +2642,8 @@ "minimist": { "version": "0.0.8", "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true }, "mississippi": { "version": "4.0.0", @@ -2709,6 +2710,7 @@ "version": "0.5.1", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, "requires": { "minimist": "0.0.8" } diff --git a/package.json b/package.json index 3848796f..46277111 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,6 @@ "jsforce": "^1.7.0", "merge-stream": "^2.0.0", "mississippi": "^4.0.0", - "mkdirp": "^0.5.1", "multimatch": "^4.0.0", "parse-diff": "^0.7.0", "split2": "^3.0.0",