Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
clearOutputPath: function(outputPath) {
if (!fs.existsSync(outputPath)) { return Promise.resolve(); }
var entries = fs.readdirSync(outputPath);
return Promise.map(entries, function(entry){
return rimraf(path.join(outputPath, entry));
});
},
return glob(exclusion, { cwd: dir, matchBase: true }).then(function(entries){
return Promise.map(entries, function(entry) {
return rimraf(path.join(dir, entry));
});
});
});
deleteExcluded: function(dir, config){
var exclusions = config.get('assets.exclude');
return Promise.map(exclusions, function(exclusion){
return glob(exclusion, { cwd: dir, matchBase: true }).then(function(entries){
return Promise.map(entries, function(entry) {
return rimraf(path.join(dir, entry));
});
});
});
}
});