normalize all paths
This commit is contained in:
parent
23cdb3dfc9
commit
e7c853cd0f
1 changed files with 4 additions and 4 deletions
|
@ -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)))))
|
||||
|
|
Loading…
Reference in a new issue