slushjs / slush-angular

A slush generator for AngularJS using the Google Angular App Structure Recommendations
129 stars 32 forks source link

npm WARN deprecated gulp-clean@0.2.4: use gulp-rimraf instead #21

Closed scmx closed 9 years ago

scmx commented 10 years ago

I thought this deprecation would be an easy fix. gulp-rimraf tells us to:

Delete a folder: use rimraf directly:

So I tried:

+var rimraf = require('rimraf');
 /**
  * CSS
  */
-gulp.task('clean-css', function () {
-  return gulp.src('./.tmp/css').pipe(g.clean());
+gulp.task('clean-css', function (cb) {
+  rimraf('./.tmp/css', cb);
 });

However I get an error

[gulp] 'clean-dist' errored after 7.3 s ENOTEMPTY, rmdir 'dist/assets/fonts'

client/node_modules/gulp/node_modules/orchestrator/index.js:153
                        throw err;
                              ^
Error: ENOTEMPTY, rmdir 'dist/assets/fonts'

I guest I'm just doing it wrong.

Do you know how it should be done? Or should we open an issue at rimraf?

Might be related with https://github.com/gruntjs/grunt-contrib-clean/issues/34 or https://github.com/isaacs/rimraf/issues/25#issuecomment-28072488

raulcesar commented 10 years ago

I had same problem. Don't know if this is the best solution, but since (in my case) the "clean" task should be done first, and in a synchronous manner, I just used rimraf.sync, so your code would be:

rimraf.sync('./.tmp/css');

Also note, that because its synchronous, there is no need for a callback.