From ebe7e38ec8dfb749d90d697296072da511eeb2bc Mon Sep 17 00:00:00 2001 From: Oj Date: Tue, 25 Jan 2022 22:48:40 +0000 Subject: [PATCH] [Poly > Mkdirp] Simplify, remove logs --- polyfills/mkdirp.js | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/polyfills/mkdirp.js b/polyfills/mkdirp.js index c52f4e8..f6a16ed 100644 --- a/polyfills/mkdirp.js +++ b/polyfills/mkdirp.js @@ -1,21 +1,16 @@ // Minimal wrapper mimicking mkdirp package const fs = require('fs'); -const async = (path, callback) => { // async - log('Mkdirp', 'Async:', path); - - fs.mkdir(path, { recursive: true }, () => { // Ignore errors (already exists) +const mk = (path, callback) => { // async + fs.mkdir(path, { recursive: true }, () => { // Already exists, ignore callback(); }); }; -const sync = (path) => { // sync - log('Mkdirp', 'Sync:', path); - +mk.sync = (path) => { // sync try { fs.mkdirSync(path, { recursive: true }); } catch (e) { } // Already exists, ignore }; -async.sync = sync; -module.exports = async; \ No newline at end of file +module.exports = mk; \ No newline at end of file