Fork me on GitHub
#tools-deps
<
2022-09-06
>
socksy17:09:25

is there an easy way to list the local/roots (and only the local/roots) recursively? Would be great for CI scripting in a monorepo

Alex Miller (Clojure team)17:09:22

no, but you can get the data with which to compute this either programatically or via clj -X:deps tree :format :edn

souenzzo12:09:56

I had this problem, did this solution. But in my case, this solution is too slow, and requires to download all the deps. End up parsing deps.edn manually and searching for any map with :local/root inside it, in a recur way. cc @U066F8MGF

socksy13:09:41

but there the issue is that you want to have the resolution of the :local/roots of those deps, which you get for "free" with clj -X:deps list . Unfortunately it does not seem so straightforward to filter out the :local/roots there — I guess a tree walker is needed with clj -X:deps tree

Alex Miller (Clojure team)17:09:13

or clj -X:deps list :format :edn if the structure doesn't matter as much as the end list

Alex Miller (Clojure team)17:09:43

throw some bb on that and you're in business :)

babashka 3