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

feat: add global precondition #1993

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Conversation

vmaerten
Copy link
Member

@vmaerten vmaerten commented Jan 5, 2025

Fixes #294

It's a fairly popular feature

@vmaerten
Copy link
Member Author

vmaerten commented Jan 5, 2025

I was wondering how it should behave if an included Taskfile defines global preconditions:

  1. Should it produce an error (similar to dotenv)?
  2. Should all preconditions be merged and applied together?
  3. Should the global preconditions in the included Taskfile be ignored?

I started with the 2 in mind, but I am not sure anymore

Any thought ? cc @pd93 / @andreynering

@pd93
Copy link
Member

pd93 commented Jan 5, 2025

As a user, I would expect 2. This is also the safer option if we maintain the principle of "its safer to not run a task that was intended to run than it is to run one that wasn't."

@vmaerten vmaerten marked this pull request as ready for review January 7, 2025 20:25
@vmaerten
Copy link
Member Author

vmaerten commented Jan 7, 2025

I followed the same pattern we have with vars.
I am not a huge fan of naming preconditions inside preconditions, maybe values ?
I you have some naming ideas

@vmaerten vmaerten requested review from andreynering and pd93 January 7, 2025 20:26
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

Successfully merging this pull request may close these issues.

Add global preconditions
2 participants