Fork me on GitHub
#tools-deps
<
2020-07-03
>
arohner15:07:23

is there a way to exclude a dep from the tree, regardless of how it got there?

arohner15:07:40

:exclusions appears to be per-dep only, but I want to assert e.g. logback should never be present

neumann19:07:45

Is there a way to replace or remove paths in an alias? I want to exclude on of my source paths in just one alias.

neumann19:07:52

My current coping mechanism is to set -Sdeps '{:paths ["some" "paths" ...]}' on the command line.

dominicm19:07:36

@neumann why not move the optional paths to an alias?

neumann19:07:02

@dominicm I'd like to avoid that because I don't want to have to specify another -A: in all of the cases except one. The extra -A: is just another thing to forget to do.

borkdude19:07:42

@neumann major hack, this removes the src path from the classpath:

[email protected]:~$ export classpath=$(clojure -Spath)
[email protected]:~$ new_classpath=$(bb -o -e '(let [path (System/getenv "classpath"), paths (str/split path #":"), paths (remove #(= "src" %) paths)] (str/join ":" paths))')
[email protected]:~$ clojure -Scp "$new_classpath"
Clojure 1.9.0
user=>

neumann19:07:24

@borkdude Nice! Yes, I was thinking of maybe using babashka. (Which is amazing! Thank you so much for creating it!)

neumann20:07:06

@borkdude Something like this, using "src" as the example:

cat deps.edn | bb -I -e '(->> *input* first :paths (remove #{"src"}) vec)'

borkdude20:07:25

@neumann if you need only one EDN input value:

$ cat deps.edn | bb -e '(->> *input* :paths (remove #{"src"}) vec)'
["parser" "resources" "inlined"]

borkdude20:07:44

-I is for collecting a lazy seq of multiple EDN input values

neumann20:07:21

Oh! Very nice! Thanks!