Skip to content

Commit 12c142c

Browse files
olivergeorgeswannodette
authored andcommitted
CLJS-2036: Relative path exception thrown when :preloads requires a :foreign-lib
Update relative-name to support Windows by normalising the format of the user.dir system property value.
1 parent 8a27f89 commit 12c142c

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/main/clojure/cljs/util.cljc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,9 @@
148148
[x]
149149
{:pre [(or (file? x) (url? x))]}
150150
(letfn [(strip-user-dir [s]
151-
(string/replace s
152-
(str (System/getProperty "user.dir") File/separator) ""))]
151+
(let [user-dir (str (System/getProperty "user.dir") File/separator)
152+
user-path (.getFile (.toURL (io/file user-dir)))]
153+
(string/replace s user-path "")))]
153154
(if (file? x)
154155
(strip-user-dir (.getAbsolutePath x))
155156
(let [f (.getFile x)]

0 commit comments

Comments
 (0)