From e7c853cd0ffa1adb4ecfd37f48c628051ce41579 Mon Sep 17 00:00:00 2001 From: jem Date: Thu, 30 Jan 2020 11:12:06 +0100 Subject: [PATCH] normalize all paths --- src/cryogen_core/classpath_able_io.clj | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cryogen_core/classpath_able_io.clj b/src/cryogen_core/classpath_able_io.clj index b11aaaa..7abd6ed 100644 --- a/src/cryogen_core/classpath_able_io.clj +++ b/src/cryogen_core/classpath_able_io.clj @@ -12,7 +12,7 @@ [schema.core :as s]) (:import [java.net URI] [java.util.jar JarFile JarEntry] - [java.nio.file FileSystems Paths Files SimpleFileVisitor LinkOption StandardCopyOption] + [java.nio.file FileSystems Paths Files LinkOption StandardCopyOption] [java.nio.file.attribute FileAttribute])) ; -------------------- Domain Definition ------------------------------ @@ -74,14 +74,14 @@ (filter #(not (re-matches ignore-patterns %)) source-list)) ; ------------------- infra --------------------------------- -(defn current-path []) - (defn user-dir [] (java.lang.System/getProperty "user.dir")) (defn absolut-path [& path-elements] - (let [path (Paths/get (first path-elements) (into-array String (rest path-elements)))] + (let [path (.normalize + (Paths/get (first path-elements) + (into-array String (rest path-elements))))] (if (.isAbsolute path) path (Paths/get (user-dir) (into-array String path-elements)))))