1
0
mirror of https://github.com/janet-lang/janet synced 2024-11-28 19:19:53 +00:00

Don't run main when flychecking.

This commit is contained in:
Calvin Rose 2020-08-29 09:05:18 -05:00
parent f60348eee4
commit 5313963baf

View File

@ -2859,9 +2859,10 @@
(def subargs (array/slice args i))
(put env :args subargs)
(dofile arg :prefix "" :exit *exit-on-error* :evaluator evaluator :env env)
(unless *compile-only*
(if-let [main (get (in env 'main) :value)]
(let [thunk (compile [main ;(tuple/slice args i)] env arg)]
(if (function? thunk) (thunk) (error (thunk :error)))))
(if (function? thunk) (thunk) (error (thunk :error))))))
(set i lenargs))))
(when (and (not *compile-only*) (or *should-repl* *no-file*))