Closed gamecubate closed 7 years ago
Yep it makes sense because sh
is not a task. In order to get what you want to achieve you have to wrap it into a with-pass-thru
.
Hope it helps! -- Sent from my Android device with K-9 Mail. Please excuse my brevity.
Thanks @arichiardi.
No problem! Sample here.
Great. I was just about to ask for one. :)
Actually... getting errors of the type Cannot run program "/usr/bin/make all": error=2, No such file or directory
. Here's my task:
(deftask release []
"Compile for release"
(task-options! cljs {:optimizations :advanced})
(comp
(build)
(sift :include #{#"index.html" #"css/*" #"js/app.js"})
(target :dir #{"release"})
(with-pass-thru _
(let [{:keys [exit out err]} (sh "/usr/bin/make all")]
(println out)
(when-not (zero? exit)
(println err))))))
The Makefile is in the same directory as build.boot. Assuming that the task's cwd is not that from which `boot release``` was launched.
It should work, I am basically doing something similar (but with dosh
) here too.
EDIT: add line
Great example. Will try it out immediately. Thanks!
Worked perfectly. Thanks again.
(require
...
'[boot.util :as util])
(deftask release []
"Compile for release"
(task-options! cljs {:optimizations :advanced})
(comp
(build)
(sift :include #{#"index.html" #"css/*" #"js/app.js"})
(target :dir #{"release"})
(with-pass-thru _
(util/info "make all...\n")
(util/dosh "make" "all"))))
This works very well. I later realized that same results could have been obtained by adding a boot release
command to my Makefile target:
all:
boot release
scp ...
I have a Makefile and would like to invoke a
make all
shell command at the completion of my (boot) release task.So I did this:
That clearly fails as make seems to be invoked immediately, cutting off execution of the previous tasks, and is then followed by a java.lang.NullPointerException error.
I tried this with
sh
as well. In that case, the command fails immediately (no make execution) and is again followed by a java.lang.NullPointerException error.