just icon indicating copy to clipboard operation
just copied to clipboard

Recovery Dependencies - Execute Receipe(s) on Recipe Failure

Open ArchieAtkinson opened this issue 8 months ago • 1 comments

This PR adds the || syntax to the dependency system, allowing recipes to run on failure.

This is based on discussion in https://github.com/casey/just/issues/2583

Example:

# justfile
foo: || bar
  echo foo
   exit 1

bar:
  echo bar

# stdout
foo
bar

Please let me know if any additional work needs to be done or changes to the current behaviour.

One potential improvement that could be considered is passing the status code from the failing recipe into the recovery recipes

ArchieAtkinson avatar Apr 14 '25 18:04 ArchieAtkinson

Thank you for the PR! Just a warning, I'm super backlogged, so I'm not sure when I'll be able to review this. Just letting you know so that you don't interpret no response as the PR not being welcome or interesting!

casey avatar Apr 15 '25 16:04 casey