Closed pesterhazy closed 7 years ago
@arichiardi, I've amended the docstring for --once
Yes, it is intentional that you can call multiple functions or pieces of code and even mix both, e.g.
boot call --print --function clojure-version --function all-ns --eval "(+ 3 4)" --eval "(- 1 5)"
Evals are executed after function calls.
I really like this task. One thing I would advocate for as well would be an option to call it in the pre section of the task or in the post section.
I recently created a simple task allowing me to do that and used it in a project of mine to stop my custom application system before running the build and refresh
ing the code. Then as the post portion of the same task (i.e. after all those other tasks have successfully run), I restart my system with another function call.
So, either another task call-after
that is nearly identical, or (my preference) options for this task to call the same types of things in the post portion of the task.
This task would solve an issue I had recently with starting nodejs for a ClojureScript build target with watch
, where I then had write my own task using delay
with with-pass-truh
to only start node once after after the initial compile.
@kommen, your suggestion sounds good, I actually debated whether to add this to the initial pr. I'll add a --post flag when I'm back from vacation.
Sorry the last comment was directed at @radicalzephyr
As suggested by @RadicalZephyr, I've updated the PR to include a --post
flag.
I like it. Can you please add to CHANGES.md
? Thanks!
@alandipert I've added the changelog entry and squashed the commits
This task can be used for ad-hoc code, either from the command line or from build.boot. Use cases:
lein run
boot call --print -f clojure-version
boot watch cljs call --once -f my.project/start
As used from build.boot, the call task has the advantage that new users don't need to learn about with-pass-thru to execute project code.
The
--eval
option allows to execute an arbitrary Clojure from. It is similar to boot's--init
but can be run as part of a boot pipeline.