diff --git a/src/cryogen_core/classpath_able_io.clj b/src/cryogen_core/classpath_able_io.clj index de6ab02..0fa0852 100644 --- a/src/cryogen_core/classpath_able_io.clj +++ b/src/cryogen_core/classpath_able_io.clj @@ -14,13 +14,19 @@ [ignore-patterns source-list] (filter #(not (re-matches ignore-patterns %)) source-list)) +; TODO: Datenstruktur [s/Str] + (defn delete-file-recursive [folders] - (let [file-list (filter #(.isFile %) folders) - dir-list (filter #(not (.isFile %)) folders)] - (doseq [file file-list] (io/delete-file file)) - (when (not (empty? dir-list)) - (recur (drop 1 dir-list))))) + (when (not (empty? 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)) + (when (not (empty? dir-list)) + (recur (drop 1 dir-list))) + (io/delete-file file-to-work-with)))) (defn file-from-cp [resource-path] diff --git a/test/cryogen_core/classpath_able_io_test.clj b/test/cryogen_core/classpath_able_io_test.clj index f74b47b..a83dbf3 100644 --- a/test/cryogen_core/classpath_able_io_test.clj +++ b/test/cryogen_core/classpath_able_io_test.clj @@ -27,7 +27,7 @@ (is (do (.mkdir (io/file target)) - (sut/delete-file-recursive (io/file target)) + (sut/delete-file-recursive (seq (io/file target))) (not (verify-dir-exists target))))) (deftest test-file-from-cp-or-filesystem