Skip to content

Commit b17edea

Browse files
committed
CLJS-1169: cannot use REPL load-file on files that declare single segment namespaces
cljs.util/to-target-file: * don't add parents to path if there aren't any, this covers single segment namespaces
1 parent 726ec27 commit b17edea

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/clj/cljs/util.clj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,9 @@
7171
(let [relative-path (string/split (munge-path (str (:ns ns-info))) #"\.")
7272
parents (cond-> (butlast relative-path)
7373
target-dir (conj target-dir))]
74-
(io/file (io/file (to-path parents))
75-
(str (last relative-path) (str "." ext))))))
74+
(cond->> (io/file (str (last relative-path) (str "." ext)))
75+
(seq parents)
76+
(io/file (to-path parents))))))
7677

7778
(defn mkdirs
7879
"Create all parent directories for the passed file."

0 commit comments

Comments
 (0)