just
just copied to clipboard
Recovery Dependencies - Execute Receipe(s) on Recipe Failure
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
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!