wip
This commit is contained in:
parent
0d7521d87f
commit
549bf8275d
2 changed files with 12 additions and 6 deletions
|
@ -14,13 +14,19 @@
|
||||||
[ignore-patterns source-list]
|
[ignore-patterns source-list]
|
||||||
(filter #(not (re-matches ignore-patterns %)) source-list))
|
(filter #(not (re-matches ignore-patterns %)) source-list))
|
||||||
|
|
||||||
|
; TODO: Datenstruktur [s/Str]
|
||||||
|
|
||||||
(defn delete-file-recursive
|
(defn delete-file-recursive
|
||||||
[folders]
|
[folders]
|
||||||
(let [file-list (filter #(.isFile %) folders)
|
(when (not (empty? folders))
|
||||||
dir-list (filter #(not (.isFile %)) folders)]
|
(let [file-to-work-with (first folders)
|
||||||
|
; TODO: .list fehlt noch
|
||||||
|
file-list (filter #(.isFile %) file-to-work-with)
|
||||||
|
dir-list (filter #(not (.isFile %)) file-to-work-with)]
|
||||||
(doseq [file file-list] (io/delete-file file))
|
(doseq [file file-list] (io/delete-file file))
|
||||||
(when (not (empty? dir-list))
|
(when (not (empty? dir-list))
|
||||||
(recur (drop 1 dir-list)))))
|
(recur (drop 1 dir-list)))
|
||||||
|
(io/delete-file file-to-work-with))))
|
||||||
|
|
||||||
(defn file-from-cp
|
(defn file-from-cp
|
||||||
[resource-path]
|
[resource-path]
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
(is
|
(is
|
||||||
(do
|
(do
|
||||||
(.mkdir (io/file target))
|
(.mkdir (io/file target))
|
||||||
(sut/delete-file-recursive (io/file target))
|
(sut/delete-file-recursive (seq (io/file target)))
|
||||||
(not (verify-dir-exists target)))))
|
(not (verify-dir-exists target)))))
|
||||||
|
|
||||||
(deftest test-file-from-cp-or-filesystem
|
(deftest test-file-from-cp-or-filesystem
|
||||||
|
|
Loading…
Reference in a new issue