Remove mkdirp dependency (#2880)
This commit is contained in:
parent
e35da5b060
commit
2018b21560
|
|
@ -4,7 +4,7 @@ const fs = require('fs-extra');
|
|||
const path = require('path');
|
||||
const pathToFolder = require('./pathToFolder');
|
||||
const { promisify } = require('util');
|
||||
const mkdirp = promisify(require('mkdirp'));
|
||||
const mkdir = promisify(fs.mkdir);
|
||||
|
||||
function write(dirPath, filename, data) {
|
||||
return fs.writeFile(path.join(dirPath, filename), data);
|
||||
|
|
@ -28,7 +28,7 @@ module.exports = function storageManager(baseDir, storagePathPrefix, useHash) {
|
|||
const pathSegments = [baseDir, ...subDirs].filter(isValidDirectoryName);
|
||||
|
||||
const dirPath = path.join.apply(null, pathSegments);
|
||||
return mkdirp(dirPath).then(() => dirPath);
|
||||
return mkdir(dirPath, { recursive: true }).then(() => dirPath);
|
||||
},
|
||||
writeData(data, filename) {
|
||||
return this.createDirectory('data').then(dir =>
|
||||
|
|
|
|||
|
|
@ -98,7 +98,6 @@
|
|||
"lodash.set": "4.3.2",
|
||||
"lodash.union": "4.6.0",
|
||||
"markdown": "0.5.0",
|
||||
"mkdirp": "0.5.1",
|
||||
"node-slack": "0.0.7",
|
||||
"p-limit": "2.2.2",
|
||||
"pagexray": "2.5.9",
|
||||
|
|
|
|||
Loading…
Reference in New Issue