Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove dep on rimraf and mkdirp #1755

Merged
merged 4 commits into from
Jan 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions lib/grunt/file.js
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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