@@ -265,19 +265,22 @@ present"
265
265
(defn default-main
266
266
[repl-env {:keys [main script args repl-env-options options inits] :as cfg}]
267
267
(env/ensure
268
- (let [reopts (merge repl-env-options
269
- (select-keys options [:output-to :output-dir ]))
270
- _ (when (or ana/*verbose* (:verbose options))
268
+ (let [opts (cond-> options
269
+ (not (:output-dir options))
270
+ (assoc :output-dir (temp-out-dir )))
271
+ reopts (merge repl-env-options
272
+ (select-keys opts [:output-to :output-dir ]))
273
+ _ (when (or ana/*verbose* (:verbose opts))
271
274
(util/debug-prn " REPL env options:" (pr-str reopts)))
272
275
renv (apply repl-env (mapcat identity reopts))
273
- coptsf (when-let [od (:output-dir options )]
276
+ coptsf (when-let [od (:output-dir opts )]
274
277
(io/file od " cljsc_opts.edn" ))
275
278
copts (when (and coptsf (.exists coptsf))
276
279
(-> (edn/read-string (slurp coptsf))
277
280
(dissoc-entry-point-opts )))
278
281
opts (merge copts
279
282
(build/add-implicit-options
280
- (merge (repl/repl-options renv) options )))]
283
+ (merge (repl/repl-options renv) opts )))]
281
284
(binding [ana/*cljs-ns* 'cljs.user
282
285
repl/*repl-opts* opts
283
286
ana/*verbose* (:verbose opts)
@@ -290,7 +293,7 @@ present"
290
293
(repl/setup renv repl/*repl-opts*)
291
294
; ; REPLs don't normally load cljs_deps.js
292
295
(when (and coptsf (.exists coptsf))
293
- (let [depsf (io/file (:output-dir options ) " cljs_deps.js" )]
296
+ (let [depsf (io/file (:output-dir opts ) " cljs_deps.js" )]
294
297
(when (.exists depsf)
295
298
(repl/evaluate renv " cljs_deps.js" 1 (slurp depsf)))))
296
299
(repl/evaluate-form renv (ana-api/empty-env ) " <cljs repl>"
0 commit comments