peter-vilja / gulp-clean

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

Contant no such file or directory #20

Open suederade opened 8 years ago

suederade commented 8 years ago
var delConfig = [].concat(config.build + '**/*', config.temp);
return gulp.src(delConfig, {read: false})
    .pipe($.clean());

config.build = ./build/ config.temp = ./src/client/.tmp/

Before I changed config.build + '**/* from config.build it just kept hitting my html views and giving me a no such file error and now it just does it on random files.

suederade commented 8 years ago

Missed a .*

suederade commented 8 years ago

Need it to clean out the entire folder, so that doesn't work and I have to run gulp-clean twice to make it work.

gucong3000 commented 8 years ago

events.js:141 throw er; // Unhandled 'error' event ^

Error: ENOENT: no such file or directory, lstat '/root/.jenkins/jobs/sdist/workspace/build_act-online_1464000756822/img/4/40762a726aa1e118.png' at Error (native)

gucong3000 commented 8 years ago

If a file not found, it will throw a js Error

MrSpark2591 commented 8 years ago

this might help `var fs = require('fs'); var clean = require('gulp-clean'); function checkDirectorySync(directory) {
try { fs.statSync(directory); } catch(e) { fs.mkdirSync(directory); } }

gulp.task('cleanProduction', function () { checkDirectorySync('./production/'); return gulp.src('production') .pipe(clean({force: true})) });`

Gpia commented 8 years ago

I also found this problem.

marklabenski commented 7 years ago

The problem seems to be with using glob patterns on clean. If you remove the glob extension:

var delConfig = [].concat(config.build, config.temp);
return gulp.src(delConfig, {read: false})
    .pipe($.clean());

it should work.