Skip to content
This repository
Browse code

Remove duplicate filenames before generating the docs, fixes #45

  • Loading branch information...
commit d507a3eb4ec56c0e70ed622197be6b95b52270cd 1 parent ca3eda5
Michał Marczyk authored November 24, 2011

Showing 1 changed file with 6 additions and 7 deletions. Show diff stats Hide diff stats

  1. 13  src/marginalia/core.clj
13  src/marginalia/core.clj
@@ -79,8 +79,8 @@
79 79
   [dir]
80 80
   (->> (io/file dir)
81 81
        (file-seq)
82  
-       (filter #(re-find #"\.clj$" (.getAbsolutePath %)))
83  
-       (map #(.getAbsolutePath %))
  82
+       (filter #(re-find #"\.clj$" (.getCanonicalPath %)))
  83
+       (map #(.getCanonicalPath %))
84 84
        (sort)))
85 85
 
86 86
 ;; ## Project Info Parsing
@@ -210,10 +210,9 @@
210 210
   (if (nil? sources)
211 211
     (find-clojure-file-paths "./src")
212 212
     (->> sources
213  
-         (map #(if (dir? %)
214  
-                 (find-clojure-file-paths %)
215  
-                 [%]))
216  
-         (flatten))))
  213
+         (mapcat #(if (dir? %)
  214
+                    (find-clojure-file-paths %)
  215
+                    [(.getCanonicalPath (io/file %))])))))
217 216
 
218 217
 (defn split-deps [deps]
219 218
   (when deps
@@ -246,7 +245,7 @@
246 245
                  If not given will be taken from project.clj."]
247 246
              ["-j" "--js" "Additional javascript resources <resource1>;<resource2>;...
248 247
                  If not given will be taken from project.clj"])
249  
-        sources (format-sources (seq files))]
  248
+        sources (distinct (format-sources (seq files)))]
250 249
     (if-not sources
251 250
       (do
252 251
         (println "Wrong number of arguments passed to marginalia.")

0 notes on commit d507a3e

Please sign in to comment.
Something went wrong with that request. Please try again.