Replies: 2 comments
|
Hello! Do you want the recipe bodies before or after interpolation? |
|
There is no flag that prints only a recipe's script body. That request is still open in #737 and #1456. Before interpolation, with no args:
After interpolation: Evaluated lines go to stderr. Shebang recipes keep the Linting wants the after-interpolation form so tools do not see |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hi @casey
Is there a way to capture recipe bodies.
In general I try to write scripts (bash or otherwise) and invoke them from recipes so that I can test behaviour using e.g. bats with mocking for bash, pytest for python etc. This also allows me to lint the recipe bodies using pre-commit hooks.
However, there are cases where I don't want to do that e.g. a remote justfile where I want everything in a single file to simplify fetch.
--dry-run is close but you need to know which args the recipe expects and it interpolates.
--show gives the whole recipe
--dump is raw
I had a look at the docs and the cli args but I can't see a way to do this.
I know that just writes shebang and [script] recipe bodies to a temp file in a directory that I can control via e.g.
just --tempdir=~/dev recipeand if the script is blocking I can indeed see the script written to the directory, however just is too well behaved and cleans up after itself, and even then the shebang is not included.
Hopefully I am not missing something obvious
Cheers
All reactions