Migrate from mkdirp to fs.mkdir(recursive)

Signed-off-by: Jesse Chan <jc@linux.com>
This commit is contained in:
Jesse Chan
2020-08-04 14:03:03 +08:00
parent 0eae92faf5
commit 39b4430904
4 changed files with 5 additions and 6 deletions
+2 -1
View File
@@ -10542,7 +10542,8 @@
"mkdirp": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz",
"integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw=="
"integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==",
"dev": true
},
"moment": {
"version": "2.27.0",
-1
View File
@@ -57,7 +57,6 @@
"joi": "^13.7.0",
"jsonwebtoken": "^8.4.0",
"lodash": "^4.17.19",
"mkdirp": "^1.0.4",
"moment": "^2.27.0",
"morgan": "^1.10.0",
"multer": "^1.4.2",
+2 -2
View File
@@ -1,7 +1,7 @@
/**
* This file is deprecated in favor of clientGatewayService.
*/
const mkdirp = require('mkdirp');
const fs = require('fs');
const mv = require('mv');
const path = require('path');
const util = require('util');
@@ -70,7 +70,7 @@ class ClientRequest {
// TODO: Move this to util, doesn't belong here
createDirectory(options) {
if (options.path) {
mkdirp(options.path, (error) => {
fs.mkdir(options.path, {recursive: true}, (error) => {
if (error) {
console.trace('Error creating directory.', error);
}
+1 -2
View File
@@ -1,12 +1,11 @@
const fs = require('fs');
const mkdirp = require('mkdirp');
const path = require('path');
class TemporaryStorage {
constructor() {
this.tempPath = path.join(path.dirname(require.main.filename), '..', 'temp');
mkdirp(this.tempPath);
fs.mkdir(this.tempPath, {recursive: true});
}
deleteFile(filename) {