File tree Expand file tree Collapse file tree 1 file changed +23
-7
lines changed Expand file tree Collapse file tree 1 file changed +23
-7
lines changed Original file line number Diff line number Diff line change 1414 #? (:clj (:require [cljs.util :as util]
1515 [clojure.java.io :as io]
1616 [clojure.string :as string]
17+ [clojure.set :as set]
1718 [clojure.tools.reader :as reader]
1819 [cljs.env :as env :refer [ensure]]
1920 [cljs.tagged-literals :as tags]
14461447 (defn cljs-files-in
14471448 " Return a sequence of all .cljs and .cljc files in the given directory."
14481449 [dir]
1449- (filter
1450- #(let [name (.getName ^File %)]
1451- (and (or (.endsWith name " .cljs" )
1452- (.endsWith name " .cljc" ))
1453- (not= \. (first name))
1454- (not (contains? cljs-reserved-file-names name))))
1455- (file-seq dir))))
1450+ (map io/file
1451+ (reduce
1452+ (fn [m x]
1453+ (if (.endsWith ^String x " .cljs" )
1454+ (cond-> (conj m x)
1455+ (contains? m (str (subs x 0 (dec (count x))) " c" ))
1456+ (set/difference #{(str (subs x 0 (dec (count x))) " c" )}))
1457+ ; ; ends with .cljc
1458+ (cond-> m
1459+ (not (contains? m (str (subs x 0 (dec (count x))) " s" )))
1460+ (conj x))))
1461+ #{}
1462+ (into []
1463+ (comp
1464+ (filter
1465+ #(let [name (.getName ^File %)]
1466+ (and (or (.endsWith name " .cljs" )
1467+ (.endsWith name " .cljc" ))
1468+ (not= \. (first name))
1469+ (not (contains? cljs-reserved-file-names name)))))
1470+ (map #(.getPath ^File %)))
1471+ (file-seq dir))))))
14561472
14571473#?(:clj
14581474 (defn compile-root
You can’t perform that action at this time.
0 commit comments