Skip to content

How to run a recipe only if a particular library is present AND not run another recipe when that dependency is present #3569

Answered by timtebeek
gjd6640 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi! We added Preconditions in Rewrite 8 to allow you to express conditions that should match before your recipe runs. In your case you can likely develop two custom recipes:

  • one with a precondition that checks the library is present,
  • and another with a precondition that checks the library is not present.

Then, for each of those recipes, you can either chain visitors, or link recipes together to run the additional existing recipes that you want to invoke.

That way you have relatively straightforward individual recipes that each match in specific conditions, and only then make their changes, instead of a single recipe that always matches and attempts changes, with more complicated decisio…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@gjd6640
Comment options

@timtebeek
Comment options

Answer selected by gjd6640
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants