File tree Expand file tree Collapse file tree
src/main/clojure/clojure/tools/deps Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11Changelog
22===========
33
4+ * next
5+ * Add clojure.tools.deps.edn/user-config-dir function
46* 0.9.27 on May 13, 2026
57 * Update to Clojure 1.12.5
68* 0.9.22 on Feb 9, 2026
Original file line number Diff line number Diff line change 145145 (let [url (jio/resource " clojure/tools/deps/deps.edn" )]
146146 (read-edn (BufferedReader. (InputStreamReader. (.openStream url))))))
147147
148- (defn user-deps-path
149- " Use the same logic as clj to calculate the location of the user deps.edn.
150- Note that it's possible no file may exist at this location."
148+ (defn user-config-dir
149+ " Use the same logic as clj to calculate the location of the user config dir.
150+ Note that it's possible no dir may exist at this location.
151+ Return path as string."
151152 []
152153 (let [config-env (System/getenv " CLJ_CONFIG" )
153154 xdg-env (System/getenv " XDG_CONFIG_HOME" )
154- home (System/getProperty " user.home" )
155- config-dir (cond config-env config-env
156- xdg-env (str xdg-env File/separator " clojure" )
157- :else (str home File/separator " .clojure" ))]
158- (str config-dir File/separator " deps.edn" )))
155+ home (System/getProperty " user.home" )]
156+ (cond config-env config-env
157+ xdg-env (str xdg-env File/separator " clojure" )
158+ :else (str home File/separator " .clojure" ))))
159+
160+ (defn user-deps-path
161+ " Use the same logic as clj to calculate the location of the user deps.edn.
162+ Note that it's possible no file may exist at this location.
163+ Returns path as string."
164+ []
165+ (str (user-config-dir ) File/separator " deps.edn" ))
159166
160167(defn user-deps
161168 " Calculate the user deps.edn per user-deps-path, read and
You can’t perform that action at this time.
0 commit comments