From 47958ca3857e489e450b27c6f3266375015cba82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Mon, 23 Mar 2020 14:42:55 -0400 Subject: [PATCH] chore: replace mkdirp by make-dir@2 --- package.json | 2 +- src/cache.js | 5 ++--- yarn.lock | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index f5c11003..d2c78fed 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "dependencies": { "find-cache-dir": "^2.1.0", "loader-utils": "^1.4.0", - "mkdirp": "^0.5.3", + "make-dir": "^2.1.0", "pify": "^4.0.1", "schema-utils": "^2.6.5" }, diff --git a/src/cache.js b/src/cache.js index 7d164ff6..2fbf3418 100644 --- a/src/cache.js +++ b/src/cache.js @@ -12,7 +12,6 @@ const os = require("os"); const path = require("path"); const zlib = require("zlib"); const crypto = require("crypto"); -const mkdirpOrig = require("mkdirp"); const findCacheDir = require("find-cache-dir"); const promisify = require("pify"); @@ -24,7 +23,7 @@ const readFile = promisify(fs.readFile); const writeFile = promisify(fs.writeFile); const gunzip = promisify(zlib.gunzip); const gzip = promisify(zlib.gzip); -const mkdirp = promisify(mkdirpOrig); +const makeDir = require("make-dir"); /** * Read the contents from the compressed file. @@ -99,7 +98,7 @@ const handleCache = async function(directory, params) { // Make sure the directory exists. try { - await mkdirp(directory); + await makeDir(directory); } catch (err) { if (fallback) { return handleCache(os.tmpdir(), params); diff --git a/yarn.lock b/yarn.lock index 9c357d8f..9e199dfe 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4451,7 +4451,7 @@ mixin-deep@^1.2.0: for-in "^1.0.2" is-extendable "^1.0.1" -mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@^0.5.3: +mkdirp@^0.5.0, mkdirp@^0.5.1: version "0.5.3" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.3.tgz#5a514b7179259287952881e94410ec5465659f8c" integrity sha512-P+2gwrFqx8lhew375MQHHeTlY8AuOJSrGf0R5ddkEndUkmwpgUob/vQuBD1V22/Cw1/lJr4x+EjllSezBThzBg==