@@ -230,13 +230,19 @@ classpath. Classpath-relative paths have prefix of @ or @/")
230
230
((get-dispatch commands :init opt) ret arg))
231
231
{} inits))
232
232
233
+ (defn dissoc-entry-point-opts
234
+ " Dissoc the entry point options from the input. Necessary when the user
235
+ is trying load some arbitrary ns."
236
+ [opts]
237
+ (dissoc opts :main :output-to ))
238
+
233
239
(defn- repl-opt
234
240
" Start a repl with args and inits. Print greeting if no eval options were
235
241
present"
236
242
[repl-env [_ & args] {:keys [repl-env-options options inits] :as cfg}]
237
243
(let [renv (apply repl-env (mapcat identity repl-env-options))]
238
244
(repl/repl* renv
239
- (assoc options
245
+ (assoc ( dissoc-entry-point-opts options)
240
246
:inits
241
247
(into
242
248
[{:type :init-forms
@@ -250,16 +256,11 @@ present"
250
256
(let [renv (repl-env )
251
257
coptsf (when-let [od (:output-dir options)]
252
258
(io/file od " cljsc_opts.edn" ))
253
- opts (as->
254
- (build/add-implicit-options
255
- (merge (repl/repl-options renv) options)) opts
256
- (let [copts (when (and coptsf (.exists coptsf))
257
- (-> (edn/read-string (slurp coptsf))
258
- ; ; need to remove the entry point bits,
259
- ; ; user is trying load some arbitrary ns
260
- (dissoc :main )
261
- (dissoc :output-to )))]
262
- (merge copts opts)))]
259
+ copts (when (and coptsf (.exists coptsf))
260
+ (-> (edn/read-string (slurp coptsf))
261
+ (dissoc-entry-point-opts )))
262
+ opts (merge copts (build/add-implicit-options
263
+ (merge (repl/repl-options renv) options)))]
263
264
(binding [ana/*cljs-ns* 'cljs.user
264
265
repl/*repl-opts* opts
265
266
ana/*verbose* (:verbose opts)
0 commit comments