"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
[source-dir target-file ignore-patterns]
[source-dir target-dir ignore-patterns]
(let [source-list (.list source-dir)]
(io/make-parents target-file)
(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
[fs-prefix source-path target-path ignore-patterns]
@ -52,8 +57,7 @@
)))
(defn copy-resources-from-theme
[fs-prefix theme target]
(let [source-path (str "templates/themes/" theme "/js")
target-path (str target "/js")]
[fs-prefix theme target-path]
(let [source-path (str "templates/themes/" theme "/js")]
(copy-resources fs-prefix source-path target-path "")))

View file

@ -30,7 +30,12 @@
(deftest test-copy-resources-from-theme
(is (do
(sut/copy-resources-from-theme "./" theme target)
(and (verify-dir-exists
(and (verify-dir-exists
(str target "/templates/themes/bootstrap4-test/js"))
(verify-file-exists
(str target "/templates/themes/bootstrap4-test/js/dummy.js"))))))
(verify-file-exists
(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"))
))))