Skip to content

Commit

Permalink
replace deprecated fs.exists with fs.existsSync
Browse files Browse the repository at this point in the history
  • Loading branch information
ath0mas committed Mar 26, 2021
1 parent 6be1154 commit 721e35f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ function remove(root, done) {
}
}).once('end', function() {
map(dirs, 1, function(dirname, next) {
fs.exists(dirname, function(exists) {
if (!exists) return next()

rimraf(dirname, next)
})
if (fs.existsSync(dirname)) {
rimraf(dirname, next);
} else {
next();
}
}, function(err) {
done(err);
});
Expand Down

0 comments on commit 721e35f

Please sign in to comment.