Fork me on GitHub

is there a way to specify a path to a specific deps.edn file when using clj?


writing a bash script in one dir to build a module at another path


obv easy to work around, was just wondering if I was missing something obvious. thanks!


@mss fwiw, deps.clj does support this with the non-standard -Sdeps-file option

🙌 4

@mss If you do CLJ_CONFIG=/path/to/other/folder cllj it will look there for the user-level deps.edn (instead of you home directory) which might give you part of the solution?


I like the -Sdeps-file idea tho'. I would use that quite often I suspect if clojure supported it. @alexmiller would that even be considered as an enhancement?


I often use it when I need the classpath from some other project in some other directory to lint with clj-kondo


although $ ( cd /tmp/project ; clojure -Spath ) works too


I suppose you can always use clj -Sdeps "$(cat /path/to/deps.edn)"

👍 4

that works, but your local deps.edn will still be merged in, which is not always what I want


-Sdeps-file will regard that file instead of the local deps.edn


Yeah, there are a lot of possibilities around which combination of files you might want to work from.

Alex Miller (Clojure team)21:02:32

I've walked down the path of adding this a couple times for different reasons but there are a lot of unobvious consequences

Alex Miller (Clojure team)21:02:56

like do you interpret relative paths in deps.edn from the deps.edn location or current location?

Alex Miller (Clojure team)21:02:41

there are also now a lot of code locations that assume the deps.edn name, not just in tools.deps.alpha but in external tools around it

Alex Miller (Clojure team)21:02:33

at the moment the tradeoffs don't seem worth it to me but I am interested to hear about cases where people need stuff like this though so I can continue to evaluate that