Fork me on GitHub
#tools-deps
<
2018-05-16
>
kenny17:05:03

Is there a way to print the final deps.edn as data to stdout?

Alex Miller (Clojure team)18:05:34

you could use the output of -Sdescribe + a few calls in the api to replicate it

kenny18:05:03

Cool, figured it out. That option would be useful 🙂

kenny18:05:28

For those interested... Some psuedo code:

(defn full-deps-edn
  []
  (let [config-files (:config-files (exec-sync-edn "clj -Sdescribe"))
        deps "'{:deps {org.clojure/tools.deps.alpha {:mvn/version \"0.5.435\"}}}'"
        code (str/join " " ['(require '[clojure.tools.deps.alpha.reader :as reader])
                            (list 'reader/read-deps config-files)])
        cmd (str "clj -Sdeps " deps " -e '" code "'")]
    (exec-sync-edn cmd)))