"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]
|
(:require [clojure.java.io :as io]
|
||||||
[clojure.string :as s]))
|
[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
|
(defn file-from-cp
|
||||||
[resource-path]
|
[resource-path]
|
||||||
(let [file-from-cp (io/file (io/resource resource-path))]
|
(let [file-from-cp (io/file (io/resource resource-path))]
|
||||||
|
@ -35,6 +39,7 @@
|
||||||
from-fs
|
from-fs
|
||||||
(file-from-cp resource-path))))
|
(file-from-cp resource-path))))
|
||||||
|
|
||||||
|
; TODO: fix recursion as we put function calls on callstack here
|
||||||
(defn copy-dir
|
(defn copy-dir
|
||||||
[source-dir target-dir ignore-patterns]
|
[source-dir target-dir ignore-patterns]
|
||||||
(let [source-list (.list source-dir)]
|
(let [source-list (.list source-dir)]
|
||||||
|
@ -45,7 +50,7 @@
|
||||||
(do
|
(do
|
||||||
(io/make-parents target-file)
|
(io/make-parents target-file)
|
||||||
(io/copy f 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
|
(defn copy-resources
|
||||||
[fs-prefix source-path target-path ignore-patterns]
|
[fs-prefix source-path target-path ignore-patterns]
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
(deftest test-filter-for-ignore-patterns
|
(deftest test-filter-for-ignore-patterns
|
||||||
(is (=
|
(is (=
|
||||||
["file.js"]
|
["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
|
(deftest test-file-from-cp
|
||||||
(is
|
(is
|
||||||
|
|
Loading…
Reference in a new issue