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

does run-sequence can make deps only run one same as gulp? #98

Closed
bluelovers opened this issue Oct 30, 2017 · 3 comments
Closed

does run-sequence can make deps only run one same as gulp? #98

bluelovers opened this issue Oct 30, 2017 · 3 comments
Labels

Comments

@bluelovers
Copy link

does run-sequence can make deps only run one same as gulp?

[02:51:46] Starting 'transactions:history:default'...
[02:51:46] Starting 'transactions:client'...
[02:51:46] Finished 'transactions:client' after 332 μs
[02:51:46] Starting 'transactions:history:sells'...
[02:51:51] Finished 'transactions:history:sells' after 5.04 s
[02:51:51] Starting 'transactions:client'...
[02:51:51] Finished 'transactions:client' after 15 μs
[02:51:51] Starting 'transactions:history:buys'...

transactions:client is dep for transactions:history:buys & transactions:history:sells
but it shouldn't run > 1 time

any options for this?

@OverZealous
Copy link
Owner

The way run-sequence works, it cannot do this nor can it support it. run-sequence works by asking gulp to run each item in the sequential list, then listening for the completion event, then starting the next. As far as gulp is concerned, each item in the list is run independently.

You'll need to remove the traditional dependency to support your use case. You could move the :history:buys and :sells tasks into "private" tasks, which are don't have any dependencies, then create new tasks with dependencies and use run-sequence to start the "private" tasks with the dependencies. That's obviously getting a bit convoluted, though.

gulp.task('$transactions:history:sells', () => {
    // existing task here
});
gulp.task('transactions:history:sells', ['transactions:client'], (cb) => {
    runSequence('$transactions:history:sells', cb);
});

gulp.task('full-sequence', (cb) => {
  runSequence('transactions:client',
        '$transactions:history:sells',
        '$transactions:history:buys', cb);
});

@bluelovers
Copy link
Author

nvm i make a hack do this now gulp-run-seq-unique

@OverZealous
Copy link
Owner

Cool, works for me!

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

No branches or pull requests

2 participants