-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
task not waiting for dependency to finish #899
Comments
Some progress. This seems to work
although I am wondering whether it should |
Duplicate of robrich/orchestrator#15. Sadly using gulp.start inside a task and using the "when it's done" function together with dependencies does bad things in gulp 3. This is one of the main things we're resolving in gulp 4. |
@robrich Thanks for the pointer. Do you know anything about the state/release plan for gulp 4? |
Sorry, I don't. |
@tcurdt maybe you can already give |
I'm seeing a similar issue with tasks like this: gulp.task('one', function () {
return gulp.src('/path/file')
.pipe(somePlugin())
.pipe(gulp.dest('/path/file1'))
})
gulp.task('two', ['one'], function (done) {
// async code here reads output from task one and writes to new file
var read = readline.createInterface({ input: fs.createReadStream('/path/file1'), output: process.stdout, terminal: false}),
file = fs.createWriteStream('/path/file2');
read.on('line', function (line) {
// process line
file.write(line + '\n');
}).on('close', function () {
file.end();
done();
});
});
gulp.task('three', ['two'], function () {
// tries to read file output from task two
return gulp.src('/path/file2')
.pipe(somePlugin())
.pipe(gulp.dest('/path/file3'))
}) When I run I can open The docs indicate that this scenario is supported. I'm wondering if there's some kind of regression?
|
Use gulp4 this is not going to be fixed on the 3.x branch |
My mistake: in my example above, I was calling file.on('finish', function () { done(); });
read.on('close', function () { file.done(); }); |
@davisford 🌴 Not meant to be harsh, just letting you know we are no longer taking issues for the 3.x branch unless it is something that is a major issue we can backport easily (like node 0.12 and io.js support) 🌴 |
Even with run-sequence, I was having the same problem. Here's how I worked around it:
|
@thomashigginbotham your issue is completely different. You should just be returning your streams, always. |
I agree that it's best practice to always return a stream, and my example was simplified for readability -- I just forgot to add the return keyword when typing it out. My point still stands, as it resolved the issue of guaranteeing the file operation was complete before continuing with the next task. |
Met same issue here. Let's say there are 2 tasks, First and Second. Second runs after First. I have to explicitly using the
Without the
|
Shouldn't this work?
Unfortunately
deploy
runs beforebuild
finished.The above does not work either as
clean
is run in parallel.So what's the suggested way of doing this?
The text was updated successfully, but these errors were encountered: