This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-03-07
Channels
- # announcements (20)
- # babashka (25)
- # beginners (48)
- # biff (26)
- # calva (5)
- # cider (3)
- # clara (7)
- # clerk (7)
- # clj-kondo (61)
- # cljdoc (3)
- # clojure (6)
- # clojure-austin (1)
- # clojure-conj (8)
- # clojure-europe (58)
- # clojure-nl (1)
- # clojure-norway (4)
- # clojure-poland (1)
- # clojure-uk (9)
- # cursive (2)
- # emacs (11)
- # fulcro (8)
- # graphql (10)
- # gratitude (6)
- # humbleui (10)
- # hyperfiddle (17)
- # integrant (15)
- # introduce-yourself (1)
- # leiningen (5)
- # malli (13)
- # meander (21)
- # nbb (11)
- # off-topic (15)
- # pedestal (15)
- # polylith (15)
- # quil (28)
- # rdf (2)
- # reitit (3)
- # releases (6)
- # sci (21)
- # shadow-cljs (38)
- # spacemacs (3)
- # xtdb (6)
It does not seem that carve
honours the .carve/config.edn
- only the opts
gets passed on here? - https://github.com/borkdude/carve/blob/master/src/carve/api.clj#L64
We're not seeing this behaviour:
"When invoking carve with no options, the options in .carve/config.edn
will be used." on https://github.com/borkdude/carve#options
Is there a neat way to redirect stderr to stdout/combine them using https://github.com/babashka/process (when returning as a string)? Often finding myself wanting to just return the exit-code and message, regardless of it being a success or failure, then having to check both :out
and :err
and return wherever the called program has decided to put their output
I’ve used that a load. I might be confused here, but this is how it behaves
(p/sh "cat idontexist")
{:proc #object[java.lang.ProcessImpl 0x6b373678 "Process[pid=87133, exitValue=1]"],
:exit 1,
:in
#object[java.lang.ProcessImpl$ProcessPipeOutputStream 0x14f5a7ae "[email protected]"],
:out "",
:err "cat: idontexist: No such file or directory\n",
:prev nil,
:cmd ["cat" "idontexist"]}
I usually do something like (-> (p/sh "cat idontexist") :err)
to get the message, but then I obviously have to know/check whether the output is in :err or :outyou can redirect :out
and :err
to the same stringwriter and then call str
on that stringwriter
but you might get output that's mixed up between stdout and stderr, so personally I'd just avoid doing that
Usually it’s been when I fire off several commands using pmap or future, then just want to return the result of each invocation as a map, like {:task "my-async-task" :exit (:exit proc) :message (stderr or stdout)}
It’s more if I want to gather the results and do something with it, than to dump out everything