build(gulp): refactor existing cleanup tasks

the current complexity is unjustified necessary
This commit is contained in:
Igor Minar 2015-05-19 21:53:06 -07:00
parent 0ae89ac096
commit d04a515eb0
2 changed files with 9 additions and 18 deletions

View File

@ -18,7 +18,6 @@ var path = require('path');
var semver = require('semver'); var semver = require('semver');
var watch = require('./tools/build/watch'); var watch = require('./tools/build/watch');
var clean = require('./tools/build/clean');
var transpile = require('./tools/build/transpile'); var transpile = require('./tools/build/transpile');
var pubget = require('./tools/build/pubget'); var pubget = require('./tools/build/pubget');
var linknodemodules = require('./tools/build/linknodemodules'); var linknodemodules = require('./tools/build/linknodemodules');
@ -134,17 +133,17 @@ gulp.task('build/clean.tools', function() {
del(path.join('dist', 'tools')); del(path.join('dist', 'tools'));
}); });
gulp.task('build/clean.js', clean(gulp, gulpPlugins, { gulp.task('build/clean.js', function(done) {
path: CONFIG.dest.js.all del(CONFIG.dest.js.all, done);
})); });
gulp.task('build/clean.dart', clean(gulp, gulpPlugins, { gulp.task('build/clean.dart', function(done) {
path: CONFIG.dest.dart del(CONFIG.dest.dart, done);
})); });
gulp.task('build/clean.docs', clean(gulp, gulpPlugins, { gulp.task('build/clean.docs', function(done) {
path: CONFIG.dest.docs del(CONFIG.dest.docs, done);
})); });
// ------------ // ------------

View File

@ -1,8 +0,0 @@
var del = require('del');
module.exports = function(gulp, plugins, config) {
return function(done) {
del(config.path, done);
};
};