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])
|
[schema.core :as s])
|
||||||
(:import [java.net URI]
|
(:import [java.net URI]
|
||||||
[java.util.jar JarFile JarEntry]
|
[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]))
|
[java.nio.file.attribute FileAttribute]))
|
||||||
|
|
||||||
; -------------------- Domain Definition ------------------------------
|
; -------------------- Domain Definition ------------------------------
|
||||||
|
@ -74,14 +74,14 @@
|
||||||
(filter #(not (re-matches ignore-patterns %)) source-list))
|
(filter #(not (re-matches ignore-patterns %)) source-list))
|
||||||
|
|
||||||
; ------------------- infra ---------------------------------
|
; ------------------- infra ---------------------------------
|
||||||
(defn current-path [])
|
|
||||||
|
|
||||||
(defn user-dir []
|
(defn user-dir []
|
||||||
(java.lang.System/getProperty "user.dir"))
|
(java.lang.System/getProperty "user.dir"))
|
||||||
|
|
||||||
(defn absolut-path
|
(defn absolut-path
|
||||||
[& path-elements]
|
[& 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)
|
(if (.isAbsolute path)
|
||||||
path
|
path
|
||||||
(Paths/get (user-dir) (into-array String path-elements)))))
|
(Paths/get (user-dir) (into-array String path-elements)))))
|
||||||
|
|
Loading…
Reference in a new issue