mirror of https://github.com/status-im/reagent.git
Cleanup
This commit is contained in:
parent
27ef8a42fd
commit
680b19a772
|
@ -165,29 +165,24 @@
|
||||||
(defn path [] (js/require "path"))
|
(defn path [] (js/require "path"))
|
||||||
|
|
||||||
(defn mkdirs [f]
|
(defn mkdirs [f]
|
||||||
(let [items (as-> f _
|
(doseq [d (reductions #(str %1 "/" %2)
|
||||||
(.' (path) normalize _)
|
(-> (.' (path) normalize f)
|
||||||
(string/split _ #"/"))]
|
(string/split #"/")))]
|
||||||
(doseq [d (reductions #(str %1 "/" %2) items)]
|
(when-not (.' (fs) existsSync d)
|
||||||
(when-not (.' (fs) existsSync d)
|
(.' (fs) mkdirSync d))))
|
||||||
(.' (fs) mkdirSync d)))))
|
|
||||||
|
|
||||||
(defn write-file [f content]
|
(defn write-file [f content]
|
||||||
(mkdirs (.' (path) dirname f))
|
(mkdirs (.' (path) dirname f))
|
||||||
(.' (fs) writeFileSync f content))
|
(.' (fs) writeFileSync f content))
|
||||||
|
|
||||||
(defn read-file [f]
|
|
||||||
(.' (fs) readFileSync f))
|
|
||||||
|
|
||||||
(defn path-join [& paths]
|
(defn path-join [& paths]
|
||||||
(apply (.' (path) :join) paths))
|
(apply (.' (path) :join) paths))
|
||||||
|
|
||||||
(defn read-files [files]
|
|
||||||
(string/join "\n" (map read-file files)))
|
|
||||||
|
|
||||||
(defn write-resources [dir {:keys [css-file css-infiles]}]
|
(defn write-resources [dir {:keys [css-file css-infiles]}]
|
||||||
(write-file (path-join dir css-file)
|
(write-file (path-join dir css-file)
|
||||||
(read-files css-infiles)))
|
(->> css-infiles
|
||||||
|
(map #(.' (fs) readFileSync %))
|
||||||
|
(string/join "\n"))))
|
||||||
|
|
||||||
|
|
||||||
;;; Main entry points
|
;;; Main entry points
|
||||||
|
|
Loading…
Reference in New Issue