From bd2e3ba250dcd4b16c92cae104c6998b525769e7 Mon Sep 17 00:00:00 2001 From: lukas Date: Fri, 17 Jan 2020 14:50:42 +0100 Subject: [PATCH] fixed all test & added todos --- src/cryogen_core/classpath_able_io.clj | 4 ++-- src/cryogen_core/new_io.clj | 4 ++-- test/cryogen_core/new_io_test.clj | 8 +++++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/cryogen_core/classpath_able_io.clj b/src/cryogen_core/classpath_able_io.clj index 9f4b025..2d2761f 100644 --- a/src/cryogen_core/classpath_able_io.clj +++ b/src/cryogen_core/classpath_able_io.clj @@ -10,7 +10,7 @@ (:require [clojure.java.io :as io] [clojure.string :as st] [schema.core :as s]) - (:import [java.nio.file FileSystems Paths Files LinkOption StandardCopyOption] + (:import [java.nio.file FileSystems Paths Files SimpleFileVisitor LinkOption StandardCopyOption] [java.nio.file.attribute FileAttribute])) (def SourceType (s/enum :classpath :filesystem)) @@ -179,7 +179,7 @@ :else (recur (into (drop 1 paths) (map #(str path-to-work-with "/" %) - (.list (io/file (.toString (:java-path resource-to-work-with)))))) ; TODO better function + (.list (io/file (.toString (:java-path resource-to-work-with)))))) ; TODO doesnt work in jars result)))) result))) diff --git a/src/cryogen_core/new_io.clj b/src/cryogen_core/new_io.clj index 7c2410b..6503c38 100644 --- a/src/cryogen_core/new_io.clj +++ b/src/cryogen_core/new_io.clj @@ -48,5 +48,5 @@ (let [resources (get-distinct-markup-dirs fs-prefix posts pages ignore-patterns)] (doseq [resource resources] - (io/make-parents (io/file (str target-path "/" (:path resource)))) - (.mkdir (io/file (str target-path "/" (:path resource))))))) + (io/make-parents (io/file (str target-path "/" (:short-path resource)))) + (.mkdir (io/file (str target-path "/" (:short-path resource))))))) diff --git a/test/cryogen_core/new_io_test.clj b/test/cryogen_core/new_io_test.clj index cd6efea..b9e94d3 100644 --- a/test/cryogen_core/new_io_test.clj +++ b/test/cryogen_core/new_io_test.clj @@ -24,9 +24,9 @@ "test_pages/home" "test_posts" "test_posts/home"] - (sort (map :path + (sort (map :short-path (sut/get-distinct-markup-dirs - "not-existing-get-from-cp" + "./not-existing-get-from-cp" "test_posts" "test_pages" "")))))) @@ -34,7 +34,9 @@ (is (do (sut/delete-resource-recursive! (str target "2")) (sut/create-dirs-from-markup-folders! - "not-existing-get-from-cp" "test_posts" "test_pages" + "./not-existing-get-from-cp" + "test_posts" + "test_pages" (str target "2") "") (and (ftt/verify-dir-exists (str (str target "2") "/test_pages"))