Skip to content

Commit 628a82b

Browse files
chore: get rid of glob dependencies by switching del with rimraf (#4258)
Replacing del gets rid of about 10 extra dependencies, most are related to globbing, like globby, fast-glob and dir-glob. del wraps rimraf in promisify and adds 1. more sophisticated globbing 2. deletion of multiple files at once by passing an array 3. a check to prevent deleting the current working directory and outside Since the code base does not use any of the extra features, we can just wrap rimraf with promisify instead of using del. Co-authored-by: Nitin Kumar <[email protected]>
1 parent c64bd94 commit 628a82b

File tree

7 files changed

+120
-372
lines changed

7 files changed

+120
-372
lines changed

lib/Server.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1133,13 +1133,15 @@ class Server {
11331133

11341134
// cert is more than 30 days old, kill it with fire
11351135
if ((now - Number(certificateStat.ctime)) / certificateTtl > 30) {
1136-
const del = require("del");
1136+
const { promisify } = require("util");
1137+
const rimraf = require("rimraf");
1138+
const del = promisify(rimraf);
11371139

11381140
this.logger.info(
11391141
"SSL certificate is more than 30 days old. Removing..."
11401142
);
11411143

1142-
await del([certificatePath], { force: true });
1144+
await del(certificatePath);
11431145

11441146
certificateExists = false;
11451147
}

0 commit comments

Comments
 (0)