Skip to content

Guard sigil #2544

@casey

Description

@casey

We have @ and - sigils which control linewise recipe execution. I thought that we could consider having a "guard" sigil which indicates that an error on a particular line should terminate the execution of the current recipe, but not the whole run.

For example, to make a recipe only execute if the environment variable FOO is set to yes:

foo:
  ?[[ $FOO == yes]]
  # the rest of the recipe

This is backwards incompatible, so would need a setting to opt-in to the new behavior. (Although it's unlikely to break most justfile, ? at the beginning of the line is unlikely in sh and derivatives, and I think most scripting languages that people are likely to use.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions