fixed all test & added todos

This commit is contained in:
lukas 2020-01-17 14:50:42 +01:00
parent 3f30afcdcb
commit bd2e3ba250
3 changed files with 9 additions and 7 deletions

View file

@ -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)))

View file

@ -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)))))))

View file

@ -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"))