Fork me on GitHub
#tools-deps
<
2018-08-20
>
levitanong08:08:04

hi all, is there a way to run clojure such that it only downloads the dependencies and exits? Similar to lein deps. Use-case is in docker, where caching is done by diffing USEd files.

delaguardo09:08:07

clojure -e "(clojure-version)"

delaguardo09:08:44

this will download everything, print out your clojure version and exit with exit code 0

levitanong09:08:32

@delaguardo haha wouldn’t clojure -e "(System/exit 0)" work equally well in that case?

delaguardo09:08:52

I’m just copying my configuration where I’m using printed value as a part of deploy report)

dottedmag10:08:19

clojure -e '' works too

alexmiller12:08:38

clojure -Spath will work

levitanong16:08:07

@dottedmag oh that’s nice and concise! @alexmiller would clojure -Sdescribe also work?

levitanong16:08:27

I ask because that would end up printing a lot less than -Spath

ghadi16:08:35

clojure -Spath >/dev/null

ghadi16:08:44

sufficient for a dockerfile ^

levitanong16:08:04

Haha @ghadi that’s an interesting solution, but I think I’d prefer clojure -e '' to that.

ghadi16:08:39

that will launch the JVM twice, which is why alex suggested -Spath

👌 1
levitanong16:08:15

oooh, so like, once for getting the deps, and then another for launching the repl?

ghadi16:08:53

not a big deal

levitanong16:08:00

still good to know how things work! Thanks for explaining 🙂