Fork me on GitHub
#babashka
<
2022-02-25
>
lilactown04:02:46

in babashka/fs, how do I get list-dirs to recurse?

lilactown04:02:22

tried (fs/list-dirs (:dirs config) (constantly true)) but it only returns the first level (including dirs)

borkdude07:02:47

It doesn't. Use fs/glob for that

lilactown07:02:21

I ended up using fs/walk-file-tree

borkdude07:02:22

That's what glob also uses

cheel04:02:08

Hey all, just made my toy library work with babashka https://github.com/rorokimdim/pp-grid I'll put more info in a thread

🎉 1
👍 1
cheel04:02:41

Mostly works with babashka but there are some challenges due to my inexperience with clojure/bb

cheel04:02:13

You can try it out like this: put this in bb.edn

{:deps {org.clojars.rorokimdim/pp-grid {:mvn/version "0.1.12"}}}
and an example
(require '[pp-grid.api :as g])

(defn make-tables []
  (let [data [{:a 1 :b 2 :c 3}
              {:a 10 :b 20 :c 30}]
        t0 (g/table [:a :b] data)
        t1 (g/table1 [:a :b] data)
        t2 (g/table2 [:a :b] data)
        t3 (g/table3 [:a :b] data)
        matrix (g/matrix [:a :b] data)
        alphabets (g/table* (map #(g/box1 (char %)) (range 65 91)) 10)]
    (g/valign [t0 t1 t2 t3 matrix alphabets])))

(-> (make-tables)
    str
    println)
More examples available in the github repo.

cheel04:02:32

Thank you!

borkdude10:02:05

I created a channel for scittle: #scittle

🙌 3
Benjamin17:02:06

it doesn't happen in this simple case but I have something like this:

{:tasks
 {a (do (Thread/sleep 100) 'fa)
  b {:depends [a]
     :task (println a)}}}
and the symbol of the previous task routinely is a channel object instead of the result value (using --parallel, also there is multiple tasks depending on earlier tasks)

borkdude19:02:01

If you can make a repro where that happens, then I can try to debug it.

👍 1
Benjamin12:02:12

https://github.com/babashka/babashka/issues/1190 makes me want to get into generative testing lul

borkdude22:02:24

I think I finally found it, took me almost all day ;)