Commit 65d7d1b 1 parent b599fa0 commit 65d7d1b Copy full SHA for 65d7d1b
File tree 3 files changed +8
-2
lines changed
3 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 15
15
16
16
(defn parent-file ^File [^File f]
17
17
(.getParentFile f))
18
+
19
+ ; ; remove /../ parts
20
+ (defn unroll [^File f] (-> f .toPath .normalize .toFile))
Original file line number Diff line number Diff line change 129
129
path-parent (some-> m ::path file fs/parent-file)]
130
130
relation (vals (:parsed (:relations m)))
131
131
:when (not= " External" (::mode relation))
132
- :let [path (fs/unix-path (.toFile ( .normalize ( .toPath ( file path-parent (::target relation)) ))))]
132
+ :let [path (fs/unix-path (fs/unroll ( file path-parent (::target relation))))]
133
133
:when (or (:writer relation) (not (contains? result path)))
134
134
:let [src (or (:source-file relation) (file @src-parent (::target relation)))]]
135
135
[path (or (:writer relation)
Original file line number Diff line number Diff line change 25
25
(is (true ? (fs/exists? (file " /tmp" ))))
26
26
(is (true ? (fs/exists? (file " src" ))))
27
27
(is (false ? (fs/exists? (file " /does/not-exist" ))))
28
- (is (false ? (fs/exists? (file " does/not-exist" )))))
28
+ (is (false ? (fs/exists? (file " does/not-exist" )))))
29
+
30
+ (deftest test-unroll
31
+ (is (= (file " a/b/c/d" ) (fs/unroll (file " a/b/x/../c/d" )))))
You can’t perform that action at this time.
0 commit comments