just icon indicating copy to clipboard operation
just copied to clipboard

Feature request: pre-script and post-script

Open xingheng opened this issue 1 year ago • 2 comments

_setup_:
    echo "setup recipe will run BEFORE any other recipe gets triggered"

run cmd:
    echo "do something"

_teardown_:
    echo "teardown recipe will run AFTER any other recipe gets triggered"

xingheng avatar Jun 21 '24 10:06 xingheng

I think this would be pretty easy to add with a [setup] and [teardown] attribute. Modules make this more complex though. If you have a single justfile, then [setup] and [teardown] should obviously get executed whenever you run a recipe. But if you reference submodules, should the [setup] and [teardown] functions in those submodules also run whenever you run a recipe, or only when you run a recipe from that submodule?

casey avatar Jun 21 '24 20:06 casey

It seems the setup and teardown attributes didn't implement yet, sorry for that I'm not good at rust. Currently I worked on a single justfile, if it's referred as a submodule, the functions should be valid for recipes which containing in the current module justfile, I think.

xingheng avatar Jun 24 '24 04:06 xingheng