Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Event 'end' not fired #14

Open
binarykitchen opened this issue Jun 8, 2014 · 8 comments
Open

Event 'end' not fired #14

binarykitchen opened this issue Jun 8, 2014 · 8 comments

Comments

@binarykitchen
Copy link

For my project I need to reuse parts of my Gulp file for other tasks, for example cleanJs():

function cleanJs(cb) {
    gulp.src(..., {read: false})
        .pipe(clean())
        .on('end', function() {
            console.log('never called');
            cb();
        });
}

gulp.task('one task', function(cb) {
    cleanJs(cb);
    ...
});

gulp.task('other task', function(cb) {
    cleanJs(cb);
    ...
});

This does not seem to work. Not sure what the case is here or if I am doing something wrong.

@jonathanrdelgado
Copy link

Had the same problem, reverting to version 0.2.4 fixed it for me.

@binarykitchen
Copy link
Author

Yeah could do the same but IMO that's not the solution.

@jonathanrdelgado
Copy link

Absolutely, just wanted to point out the issue was created between the two versions.

@joaoneto
Copy link

+1
Guys, another workaround:

// . . .
gulp.src(CordovaLibDir)
    .pipe(clean())
    .on('error', done)
    .on('data', function () {}) // fix end emit, listen the data
    .on('end', function () {
      console.log('END');
    });

@adamayres
Copy link

+1

@Maxtermax
Copy link

@joaoneto +1

@jleppert
Copy link

@peter-vilja either maintain your package or deprecate it!

@peter-vilja
Copy link
Owner

@jleppert it's been deprecated since Jun 25, 2014 in favor of del (https://www.npmjs.com/package/del). But if people do want to use gulp-clean instead, I could look into this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants