@@ -230,13 +230,19 @@ classpath. Classpath-relative paths have prefix of @ or @/")
230230 ((get-dispatch commands :init opt) ret arg))
231231 {} inits))
232232
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+
233239(defn- repl-opt
234240 " Start a repl with args and inits. Print greeting if no eval options were
235241present"
236242 [repl-env [_ & args] {:keys [repl-env-options options inits] :as cfg}]
237243 (let [renv (apply repl-env (mapcat identity repl-env-options))]
238244 (repl/repl* renv
239- (assoc options
245+ (assoc ( dissoc-entry-point-opts options)
240246 :inits
241247 (into
242248 [{:type :init-forms
@@ -250,16 +256,11 @@ present"
250256 (let [renv (repl-env )
251257 coptsf (when-let [od (:output-dir options)]
252258 (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)))]
263264 (binding [ana/*cljs-ns* 'cljs.user
264265 repl/*repl-opts* opts
265266 ana/*verbose* (:verbose opts)
0 commit comments