Skip to content

Commit

Permalink
Merge pull request #1755 from gruntjs/rm-dep
Browse files Browse the repository at this point in the history
Remove dep on rimraf and mkdirp
  • Loading branch information
vladikoff committed Jan 31, 2023
2 parents 2d4fd38 + 1c7d483 commit 8d4c183
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
6 changes: 2 additions & 4 deletions lib/grunt/file.js
Expand Up @@ -14,9 +14,7 @@ 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;

// Windows?
var win32 = process.platform === 'win32';
Expand Down Expand Up @@ -181,7 +179,7 @@ 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: mode });
} catch (e) {
throw grunt.util.error('Unable to create directory "' + dirpath + '" (Error code: ' + e.code + ').', e);
}
Expand Down Expand Up @@ -373,7 +371,7 @@ file.delete = function(filepath, options) {
try {
// Actually delete. Or not.
if (!nowrite) {
rimraf.sync(filepath);
fs.rmSync(filepath, { recursive: true, force: true });
}
grunt.verbose.ok();
return true;
Expand Down
4 changes: 1 addition & 3 deletions package.json
Expand Up @@ -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",
Expand Down

0 comments on commit 8d4c183

Please sign in to comment.