Handle directories passed on command line

This commit is contained in:
Daniel Compton 2014-11-24 14:57:10 +13:00
parent 10ee6bd63c
commit 556981ce94

View file

@ -32,10 +32,8 @@
(defn run [source-paths & args] (defn run [source-paths & args]
(let [[options file-args usage-text] (apply (partial cli args) cli-specs) (let [[options file-args usage-text] (apply (partial cli args) cli-specs)
source-files (if (empty? file-args) source-files (mapcat #(-> % io/file find-clojure-sources-in-dir)
(mapcat #(-> % io/file find-clojure-sources-in-dir) (if (empty? file-args) source-paths file-args))]
source-paths)
file-args)]
(mapcat (fn [file] (try (check-file file :reporter (name-to-reporter (:reporter options) (mapcat (fn [file] (try (check-file file :reporter (name-to-reporter (:reporter options)
cli-reporter)) cli-reporter))
(catch Exception e (catch Exception e