remove mkdirp use
node 10.12 has { recursive: true }
This commit is contained in:
@@ -30,7 +30,6 @@ var assert = require('assert'),
|
||||
df = require('@sindresorhus/df'),
|
||||
EventEmitter = require('events'),
|
||||
fs = require('fs'),
|
||||
mkdirp = require('mkdirp'),
|
||||
path = require('path'),
|
||||
prettyBytes = require('pretty-bytes'),
|
||||
readdirp = require('readdirp'),
|
||||
@@ -86,7 +85,7 @@ function upload(apiConfig, backupFilePath, sourceStream, callback) {
|
||||
assert.strictEqual(typeof sourceStream, 'object');
|
||||
assert.strictEqual(typeof callback, 'function');
|
||||
|
||||
mkdirp(path.dirname(backupFilePath), function (error) {
|
||||
fs.mkdir(path.dirname(backupFilePath), { recursive: true }, function (error) {
|
||||
if (error) return callback(new BoxError(BoxError.EXTERNAL_ERROR, error.message));
|
||||
|
||||
safe.fs.unlinkSync(backupFilePath); // remove any hardlink
|
||||
@@ -168,7 +167,7 @@ function copy(apiConfig, oldFilePath, newFilePath) {
|
||||
|
||||
var events = new EventEmitter();
|
||||
|
||||
mkdirp(path.dirname(newFilePath), function (error) {
|
||||
fs.mkdir(path.dirname(newFilePath), { recursive: true }, function (error) {
|
||||
if (error) return events.emit('done', new BoxError(BoxError.EXTERNAL_ERROR, error.message));
|
||||
|
||||
events.emit('progress', `Copying ${oldFilePath} to ${newFilePath}`);
|
||||
|
||||
Reference in New Issue
Block a user