peter-vilja / gulp-clean

A gulp plugin for removing files and folders from given paths.
177 stars 21 forks source link

How prevent specific folder/file from deletion #33

Closed recs182 closed 5 years ago

recs182 commented 5 years ago

I want to delete everything but a folder and its files, I couldn't find a way of doing this and I found nothing that could help me.

That's what I have now:

function cleanServer(){
    return gulp.src(['!../root/dev/render/cache/*.cache', '../root/dev/'], {read: false, force: true, allowEmpty: true})
    .pipe(clean({force: true}))
        .on('error', errFn)
}

How could I delete everything but the cache folder and its files?

recs182 commented 5 years ago

I'll try to migrate to del as I saw that plugin is deprecated.