This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-08-08
Channels
- # announcements (1)
- # babashka (18)
- # beginners (32)
- # calva (3)
- # chlorine-clover (4)
- # cider (14)
- # clj-commons (24)
- # clj-kondo (1)
- # clojure (34)
- # clojure-europe (4)
- # clojure-filipino (1)
- # clojure-uk (4)
- # clojuredesign-podcast (2)
- # clojurescript (6)
- # conjure (3)
- # core-async (2)
- # datahike (1)
- # datomic (3)
- # emacs (3)
- # esprit (20)
- # fulcro (4)
- # graalvm (11)
- # helix (13)
- # honeysql (4)
- # jobs (1)
- # lumo (1)
- # observability (4)
- # off-topic (11)
- # other-lisps (6)
- # pathom (6)
- # re-frame (13)
- # reagent (1)
- # reitit (1)
- # shadow-cljs (26)
- # web-security (2)
- # xtdb (10)
Thanks! The nice thing is, you can already use it today in bb, if you just copy paste the code or use it as a git dep. I do want to include it when it's more or less finished of course.
For the pipe case, it would be better if the defaults were streams instead of strings:
(-> (process ["ls"])
(process ["grep" "README"]) :out)
I guess one could always optimize if needed:
(-> (process ["ls"] {:out :stream})
(process ["grep" "README"]) :out)
awesome to hear that this is a candidate for inclusion in babashka, seems like a perfect fit
Maybe add a pipe->
macro which forces all process
es to output streams except the last one? ¯\(ツ)/¯
Yeah, I was also thinking something like that. Maybe defaulting to streams is less opinionated though, since that's what the Java API does as well
But maybe we should not optimize for the pipe case and just write a separate function for it like (pipe ["ls"] ["cat"] {:out :inherit})
so each process will pipe to the next, and you will give opts for the last one
Hmm, I like that. Another idea: make pipe
comp
-like? It could return a fn that pipes input through the chain
(defn greper (pipe [“grep” “foo"] [“tail” “-f”]))
Or something like that
Speaking about grep and tail, I was just trying this:
https://github.com/babashka/babashka.process/issues/8
And somehow it didn't work. Need to debug it some more. If someone feels like a nice puzzle.
You do see output when you set :out
and :err
to :inherit
in the first process.