-
Notifications
You must be signed in to change notification settings - Fork 498
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Guard sigil #2544
Comments
A further enhancement that would be nice is a way for the condition to be evaluated without invoking the shell e.g.:
|
@liquidaty There would have to be a different syntax for this, since I believe the pattern of having an interpolation first is common. For example, if someone wanted to use Python to perform a test, they might do:
|
Got it. Any syntax would be fine by me, but as I'm a new That said, if it can be done, then, it seems logical (to me at least) to allow
and I can do this inside a recipe:
So it seemed logical to me that anything to the right of
Though I guess maybe the issue is that assert raises an error or returns a different data type than a shell command's exit code. |
Correct.
Yes it does work. I have justfiles that use |
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 toyes
: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 insh
and derivatives, and I think most scripting languages that people are likely to use.)The text was updated successfully, but these errors were encountered: