Skip to content

Commit bf6c946

Browse files
mfikesswannodette
authored andcommitted
CLJS-2687: cljs.main: Accept File/separator as -co and -ro delimiter
1 parent b949c7f commit bf6c946

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

src/main/clojure/cljs/cli.clj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ classpath. Classpath-relative paths have prefix of @ or @/")
203203
(missing-file str))))))
204204

205205
(defn load-edn-opts [str]
206-
(reduce merge {} (map read-edn-opts (string/split str #":"))))
206+
(reduce merge {} (map read-edn-opts (util/split-paths str))))
207207

208208
(defn- repl-env-opts-opt
209209
[cfg ropts]
@@ -552,12 +552,12 @@ present"
552552
["-ro" "--repl-opts"] {:group ::main&compile :fn repl-env-opts-opt
553553
:arg "edn"
554554
:doc (str "Options to configure the repl-env, can be an EDN string or "
555-
"colon separated list of EDN files / classpath resources. Options "
555+
"system-dependent path-separated list of EDN files / classpath resources. Options "
556556
"will be merged left to right.")}
557557
["-co" "--compile-opts"] {:group ::main&compile :fn compile-opts-opt
558558
:arg "edn"
559559
:doc (str "Options to configure the build, can be an EDN string or "
560-
"colon separated list of EDN files / classpath resources. Options "
560+
"system-dependent path-separated list of EDN files / classpath resources. Options "
561561
"will be merged left to right.")}}
562562
:main
563563
{["-r" "--repl"] {:fn repl-opt

src/main/clojure/cljs/js_deps.cljc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
;; You must not remove this notice, or any other, from this software.
88

99
(ns cljs.js-deps
10-
(:require [cljs.util :refer [distinct-by]]
10+
(:require [cljs.util :as util :refer [distinct-by]]
1111
[clojure.java.io :as io]
1212
[clojure.string :as string])
1313
(:import [java.io File]
@@ -32,7 +32,7 @@
3232
(filter (partial instance? URLClassLoader))
3333
(mapcat #(.getURLs ^URLClassLoader %)))
3434
(-> (System/getProperty "java.class.path")
35-
(string/split (re-pattern File/pathSeparator))))
35+
util/split-paths))
3636
distinct
3737
(map io/file)))
3838

src/main/clojure/cljs/util.cljc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@
111111
([parts sep]
112112
(apply str (interpose sep parts))))
113113

114+
(defn split-paths
115+
[paths-str]
116+
(string/split paths-str (re-pattern File/pathSeparator)))
117+
114118
(declare ext)
115119

116120
(defn ^File to-target-file

0 commit comments

Comments
 (0)