From 90935bab43cd588b33700f3ec32716b9cc9cccb1 Mon Sep 17 00:00:00 2001 From: jem Date: Tue, 3 Dec 2019 17:07:42 +0100 Subject: [PATCH] "Mob Session DONE [ci-skip]" --- src/cryogen_core/classpath_able_io.clj | 15 ++++++++++++++- .../themes/bootstrap4-test}/js/dummy.js | 0 2 files changed, 14 insertions(+), 1 deletion(-) rename test-resources/{ => templates/themes/bootstrap4-test}/js/dummy.js (100%) diff --git a/src/cryogen_core/classpath_able_io.clj b/src/cryogen_core/classpath_able_io.clj index 7c06e5e..687148f 100644 --- a/src/cryogen_core/classpath_able_io.clj +++ b/src/cryogen_core/classpath_able_io.clj @@ -3,5 +3,18 @@ [clojure.string :as s] [me.raynes.fs :as fs])) +(defn copy-resources + [source-path target-path] + (cond + (not (.exists (io/file source-path))) + (throw (IllegalArgumentException. (str "resource " source-path " not found"))) + (.isDirectory (io/file source-path)) + (copy-dir source-path target-path ignored-files) + :else + (fs/copy source-path target-path))) + (defn copy-resources-from-theme - [theme target]) \ No newline at end of file + [theme target] + (let [source-path (str "templates/themes/" theme "/js") + target-path (str target "/js")] + copy-resources source-path target-path)) diff --git a/test-resources/js/dummy.js b/test-resources/templates/themes/bootstrap4-test/js/dummy.js similarity index 100% rename from test-resources/js/dummy.js rename to test-resources/templates/themes/bootstrap4-test/js/dummy.js