"mob next [ci-skip]"

This commit is contained in:
Jan Krebs 2019-12-06 16:00:05 +01:00
parent 8b0ac5e800
commit 6f2a28df22
3 changed files with 18 additions and 9 deletions

View file

@ -30,11 +30,16 @@
(defn copy-dir (defn copy-dir
[source-dir target-file ignore-patterns] [source-dir target-dir ignore-patterns]
(let [source-list (.list source-dir)] (let [source-list (.list source-dir)]
(io/make-parents target-file)
(doseq [f source-list] (doseq [f source-list]
(io/copy f target-file)))) (let [target-file (io/file target-dir f)
source-file (io/file source-dir f)]
(if (.isDirectory source-file)
(copy-dir source-file target-file ignore-patterns)
(do
(io/make-parents target-file)
(io/copy f target-file)))))))
(defn copy-resources (defn copy-resources
[fs-prefix source-path target-path ignore-patterns] [fs-prefix source-path target-path ignore-patterns]
@ -52,8 +57,7 @@
))) )))
(defn copy-resources-from-theme (defn copy-resources-from-theme
[fs-prefix theme target] [fs-prefix theme target-path]
(let [source-path (str "templates/themes/" theme "/js") (let [source-path (str "templates/themes/" theme "/js")]
target-path (str target "/js")]
(copy-resources fs-prefix source-path target-path ""))) (copy-resources fs-prefix source-path target-path "")))

View file

@ -33,4 +33,9 @@
(and (verify-dir-exists (and (verify-dir-exists
(str target "/templates/themes/bootstrap4-test/js")) (str target "/templates/themes/bootstrap4-test/js"))
(verify-file-exists (verify-file-exists
(str target "/templates/themes/bootstrap4-test/js/dummy.js")))))) (str target "/templates/themes/bootstrap4-test/js/dummy.js"))
(verify-dir-exists
(str target "/templates/themes/bootstrap4-test/js/subdir"))
(verify-file-exists
(str target "/templates/themes/bootstrap4-test/js/subdir/subdummy.js"))
))))