-
Notifications
You must be signed in to change notification settings - Fork 25
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
Added stream end to the transform stream to determine when execution is done #17
Conversation
I'm finally hitting my stride on this project, and pressing F5 is finally starting to get old. This commit brings in browsersync and a bunch of gulp.watches to make workflow smoother. Due to m19c/gulp-run#17, gulp-run does not notify gulp of when the task completes. To fix this, I reimplemented those tasks in terms of the standard child_process module. I'm pretty pleased with how the tasks look now.
Thanks for the PR! Before I merge, I have a few questions. First, is it our responsibility to end the stream? Other plugins, like gulp-rename, don't appear to close the stream. Second, what does this mean when we have multiple input files? If we end the stream in the first call to I know this is an old thread, and I apologize for that. If this is still an issue, could you post your usage so I can check this out with more detail? |
I am running into the same problem. If gulp-run does not close the steam how would you do it in a simple example. Take this small bit for example.
|
Hmmm... Other than the syntax error, the example you gave above works for me. Specifically, the following gulp task calls the command var gulp = require('gulp');
var run = require( './' ); // called from within the gulp-run repo
gulp.task( 'create-hash', function() {
return run( 'git rev-parse HEAD' )
.exec()
.pipe( gulp.dest( '.' ) );
} ); That doesn't mean that nothing's broken, but the issue must be dependent on a more complex task. Or am I missing something? |
Sorry, I didn't see your response or the syntax error. When I run
I do not see Here is an illustration of the example.
Where
|
@cbarrick Did you get a chance to try out my new example? |
I just pushed a possible fix to the branch called gulp-run now properly closes the stream when used with I'll get some proper tests and merge this into master asap |
This is great news! Thanks for continuing to investigate this issue. |
I've merged my branch and published as v1.6.7 |
I had a problem that the gulp never knew when this particular stream ended, so here's a solution.
I wanted to fix the tests to instead of call(done) to listen end event and then call done, but for some reason the compare stream also never emits end. I added push(null) to bunch of places but gave up after an hour of fiddling with them. The code is semi hard to read with multiple transform streams.
I'd write the tests so that I would use highland instead of the transform streams. With highland you can use doto to do the actual expects so you won't have to deal with transform streams. I would look into this at some point, but currently I'm too busy. So here's my drive-by PR. 😁