Skip to content

Commit

Permalink
Fixes issue #555
Browse files Browse the repository at this point in the history
This modifies the file-filter function so that if the criteria seq is
empty, it simply returns an empty list.
  • Loading branch information
Daniel Manila committed May 1, 2017
1 parent 743eb05 commit 1b4bed0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions boot/core/src/boot/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -1218,10 +1218,12 @@
"A file filtering function factory. FIXME: more documenting here."
[mkpred]
(fn [criteria files & [negate?]]
(let [tmp? (partial satisfies? tmpd/ITmpFile)
->file #(if (tmp? %) (io/file (tmp-path %)) (io/file %))
pred (apply juxt (mapv mkpred criteria))]
(filter-files #(pred (->file %)) files negate?))))
(if (empty? criteria)
'()
(let [tmp? (partial satisfies? tmpd/ITmpFile)
->file #(if (tmp? %) (io/file (tmp-path %)) (io/file %))
pred (apply juxt (mapv mkpred criteria))]
(filter-files #(pred (->file %)) files negate?)))))

(defn by-meta
"This function takes two arguments: `preds` and `files`, where `preds` is a
Expand Down

0 comments on commit 1b4bed0

Please sign in to comment.