From 0072510057b3d35260a63c951f4bc86d761a4838 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jimmy=20Wa=CC=88rting?= Date: Tue, 31 Jan 2023 13:58:22 +0100 Subject: [PATCH 1/4] remove dep on rimraf and mkdirp --- lib/grunt/file.js | 4 ++-- package.json | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/grunt/file.js b/lib/grunt/file.js index 82863f35..3d632afe 100644 --- a/lib/grunt/file.js +++ b/lib/grunt/file.js @@ -14,7 +14,6 @@ file.glob = require('glob'); file.minimatch = require('minimatch'); file.findup = require('findup-sync'); var YAML = require('js-yaml'); -var rimraf = require('rimraf'); var iconv = require('iconv-lite'); var mkdirp = require('mkdirp').sync; @@ -182,6 +181,7 @@ file.mkdir = function(dirpath, mode) { if (grunt.option('no-write')) { return; } try { mkdirp(dirpath, { mode: mode }); + fs.mkdirSync(dirpath, { recursive: true, mode }) } catch (e) { throw grunt.util.error('Unable to create directory "' + dirpath + '" (Error code: ' + e.code + ').', e); } @@ -373,7 +373,7 @@ file.delete = function(filepath, options) { try { // Actually delete. Or not. if (!nowrite) { - rimraf.sync(filepath); + fs.rmSync(filepath); } grunt.verbose.ok(); return true; diff --git a/package.json b/package.json index 40c1d6c6..7d72f989 100644 --- a/package.json +++ b/package.json @@ -49,9 +49,7 @@ "iconv-lite": "~0.6.3", "js-yaml": "~3.14.0", "minimatch": "~3.0.4", - "mkdirp": "~2.1.3", - "nopt": "~3.0.6", - "rimraf": "~4.1.2" + "nopt": "~3.0.6" }, "devDependencies": { "difflet": "~1.0.1", From b01389ea6a5b6a4fc32471c739a41460a9f611cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jimmy=20W=C3=A4rting?= Date: Tue, 31 Jan 2023 15:37:57 +0100 Subject: [PATCH 2/4] remove mkdirp --- lib/grunt/file.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/grunt/file.js b/lib/grunt/file.js index 3d632afe..b039594e 100644 --- a/lib/grunt/file.js +++ b/lib/grunt/file.js @@ -15,7 +15,6 @@ file.minimatch = require('minimatch'); file.findup = require('findup-sync'); var YAML = require('js-yaml'); var iconv = require('iconv-lite'); -var mkdirp = require('mkdirp').sync; // Windows? var win32 = process.platform === 'win32'; @@ -180,7 +179,6 @@ file.expandMapping = function(patterns, destBase, options) { file.mkdir = function(dirpath, mode) { if (grunt.option('no-write')) { return; } try { - mkdirp(dirpath, { mode: mode }); fs.mkdirSync(dirpath, { recursive: true, mode }) } catch (e) { throw grunt.util.error('Unable to create directory "' + dirpath + '" (Error code: ' + e.code + ').', e); From 494f243d0cf82238c8d242772ee7c52d4416a0dd Mon Sep 17 00:00:00 2001 From: Vlad Filippov Date: Tue, 31 Jan 2023 09:59:02 -0500 Subject: [PATCH 3/4] Fix syntax --- lib/grunt/file.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/grunt/file.js b/lib/grunt/file.js index b039594e..a517fc0b 100644 --- a/lib/grunt/file.js +++ b/lib/grunt/file.js @@ -179,7 +179,7 @@ file.expandMapping = function(patterns, destBase, options) { file.mkdir = function(dirpath, mode) { if (grunt.option('no-write')) { return; } try { - fs.mkdirSync(dirpath, { recursive: true, mode }) + fs.mkdirSync(dirpath, { recursive: true, mode: mode }); } catch (e) { throw grunt.util.error('Unable to create directory "' + dirpath + '" (Error code: ' + e.code + ').', e); } From 1c7d48399766cb1a0ca48ce57cee16b2478ed842 Mon Sep 17 00:00:00 2001 From: Vlad Filippov Date: Tue, 31 Jan 2023 10:04:17 -0500 Subject: [PATCH 4/4] Add recursive --- lib/grunt/file.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/grunt/file.js b/lib/grunt/file.js index a517fc0b..9619e808 100644 --- a/lib/grunt/file.js +++ b/lib/grunt/file.js @@ -371,7 +371,7 @@ file.delete = function(filepath, options) { try { // Actually delete. Or not. if (!nowrite) { - fs.rmSync(filepath); + fs.rmSync(filepath, { recursive: true, force: true }); } grunt.verbose.ok(); return true;