Remove duplicate filenames before generating the docs, fixes #45

This commit is contained in:
Michał Marczyk 2011-11-24 22:10:13 +01:00
parent ca3eda5594
commit d507a3eb4e

View file

@ -79,8 +79,8 @@
[dir]
(->> (io/file dir)
(file-seq)
(filter #(re-find #"\.clj$" (.getAbsolutePath %)))
(map #(.getAbsolutePath %))
(filter #(re-find #"\.clj$" (.getCanonicalPath %)))
(map #(.getCanonicalPath %))
(sort)))
;; ## Project Info Parsing
@ -210,10 +210,9 @@
(if (nil? sources)
(find-clojure-file-paths "./src")
(->> sources
(map #(if (dir? %)
(find-clojure-file-paths %)
[%]))
(flatten))))
(mapcat #(if (dir? %)
(find-clojure-file-paths %)
[(.getCanonicalPath (io/file %))])))))
(defn split-deps [deps]
(when deps
@ -246,7 +245,7 @@
If not given will be taken from project.clj."]
["-j" "--js" "Additional javascript resources <resource1>;<resource2>;...
If not given will be taken from project.clj"])
sources (format-sources (seq files))]
sources (distinct (format-sources (seq files)))]
(if-not sources
(do
(println "Wrong number of arguments passed to marginalia.")