"mob next [ci-skip]"
This commit is contained in:
parent
e29c246e3b
commit
1c7720bdbf
2 changed files with 7 additions and 2 deletions
|
@ -10,6 +10,10 @@
|
|||
(:require [clojure.java.io :as io]
|
||||
[clojure.string :as s]))
|
||||
|
||||
(defn filter-for-ignore-patterns
|
||||
[ignore-patterns source-list]
|
||||
(filter #(not (re-matches ignore-patterns %)) source-list))
|
||||
|
||||
(defn file-from-cp
|
||||
[resource-path]
|
||||
(let [file-from-cp (io/file (io/resource resource-path))]
|
||||
|
@ -35,6 +39,7 @@
|
|||
from-fs
|
||||
(file-from-cp resource-path))))
|
||||
|
||||
; TODO: fix recursion as we put function calls on callstack here
|
||||
(defn copy-dir
|
||||
[source-dir target-dir ignore-patterns]
|
||||
(let [source-list (.list source-dir)]
|
||||
|
@ -45,7 +50,7 @@
|
|||
(do
|
||||
(io/make-parents target-file)
|
||||
(io/copy f target-file))
|
||||
(recur source-file target-file ignore-patterns))))))
|
||||
(copy-dir source-file target-file ignore-patterns))))))
|
||||
|
||||
(defn copy-resources
|
||||
[fs-prefix source-path target-path ignore-patterns]
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
(deftest test-filter-for-ignore-patterns
|
||||
(is (=
|
||||
["file.js"]
|
||||
(sut/filter-for-ignore-patterns #".*\\.ignore" ["file.js" "file.ignore"]))))
|
||||
(sut/filter-for-ignore-patterns #".*\.ignore" ["file.js" "file.ignore"]))))
|
||||
|
||||
(deftest test-file-from-cp
|
||||
(is
|
||||
|
|
Loading…
Reference in a new issue