rliebz / tusk

The modern task runner
https://rliebz.github.io/tusk/
MIT License
237 stars 21 forks source link

When "OR" equals query #81

Closed cuotos closed 3 years ago

cuotos commented 4 years ago

my task has a list of options, I want to run the task if either of two are provided. It doesn't appear to be possible to add multiple "equal" checks to a single When statement.

The documented example covers "if os AND/OR an option is equal, but not a case of multiple equals.

Is these another way this can be done?

    options:
      check:
        default: all
        values: 
          - all
          - option1
          - option2
    run: 
      - when:
          - equal: {check: all}
             equal: {check: option1} # cannot unmarshal if this exists.
        command: echo hi  
cuotos commented 4 years ago

i solved by own issue with

      - when:
          - equal: 
              <option name>: 
                - all
                - option1
        command: echo hi

ill try and create a PR to clarify in documentation

rliebz commented 3 years ago

Going to close this since it looks resolved. Feel free to re-open or open a new one if you run into any other issues.