Skip to content

Commit

Permalink
chore: refactor to remove function call (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
Trott committed Dec 17, 2021
1 parent 98e8710 commit 431b2b5
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions lib/clean.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ var path = require('path'),
glob = require('fast-glob'),
console = require('./console_ex'),
targets = require('./targets');
patterns = ['(*/|**/node_modules/**/)(' + targets.join('|') + ')'];


function confirm(what) {
Expand All @@ -22,14 +23,6 @@ function toKbString(bytes) {
}


/**
* Create array of patterns which will be used for cleaning
*/
function getCleanTargets() {
return ['(*/|**/node_modules/**/)(' + targets.join('|') + ')'];
}


/**
* Remove files that should be ignored
*/
Expand Down Expand Up @@ -96,7 +89,7 @@ module.exports = function* (projectDir, options) {


// Fetch files to clean in parallel
var files = yield glob(getCleanTargets(), {cwd: nmDir, onlyFiles: false});
var files = yield glob(patterns, {cwd: nmDir, onlyFiles: false});


// Nothing to delete, we're done here
Expand Down

0 comments on commit 431b2b5

Please sign in to comment.