Skip to content

Commit 07ee46c

Browse files
committed
docstrings and made read-edn public
1 parent ebf62bf commit 07ee46c

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

  • src/main/clojure/clojure/tools/deps

src/main/clojure/clojure/tools/deps/edn.clj

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
(let [abs-path (.getAbsolutePath (jio/file path))]
4444
(ex-info (format fmt abs-path) {:path abs-path})))
4545

46-
(defn- read-edn
46+
(defn read-edn
4747
"Read edn from Reader r, which should contain exactly one edn value.
4848
If source exists but is blank, nil is returned.
4949
Throws if source is unreadable or contains multiple values.
@@ -173,7 +173,10 @@
173173
(str dir/*the-dir* File/separator "deps.edn"))
174174

175175
(defn project-deps
176-
"Calculate the project deps.edn location "
176+
"Calculate the project deps.edn location, read and return the deps.edn data.
177+
178+
You may use clojure.tools.deps.util.dir/with-dir to read from a custom project
179+
dir, either absolute or relative to the current dir context."
177180
[]
178181
(-> (project-deps-path) jio/file dir/canonicalize read-deps))
179182

@@ -190,7 +193,7 @@
190193
"Takes optional map of location sources, keys = :root :user :project :extra
191194
where each key may be:
192195
:standard (default) - to get the default source
193-
string - for file path to source
196+
string - for file path to source, relative to current dir context
194197
nil - to omit
195198
map - a literal map to use
196199

0 commit comments

Comments
 (0)