gulp-patterns icon indicating copy to clipboard operation
gulp-patterns copied to clipboard

clean functions do no longer work due to change in nodes del plugin

Open MW3000 opened this issue 9 years ago • 1 comments

Description from this (http://stackoverflow.com/questions/32770896/nodes-del-command-callback-not-firing) Stackoverflow question: "The callback on the del function is not firing. The del function is running, file are deleted, I see no error messages. If I call the callback manually it executes, so looks like the function is in tact. So I am wondering what would cause del not to want to execute the callback."

This seems to be the solution: "The [del] API now returns a promise instead of accepting a callback function." https://github.com/sindresorhus/del/releases/tag/v2.0.0

MW3000 avatar Dec 04 '15 13:12 MW3000

This should work

gulp.task('clean-styles', function() {
    var files = [].concat(
        config.temp + '**/*.css',
        config.build + 'styles/**/*.css'
    );
    clean(files);
});

function clean(path) {
    log('Cleaning: ' + $.util.colors.blue(path));
    return del(path);
}

prasannakapate avatar Dec 30 '15 14:12 prasannakapate