From 5313963bafa317fb791f07e9862b45caf8006c20 Mon Sep 17 00:00:00 2001 From: Calvin Rose Date: Sat, 29 Aug 2020 09:05:18 -0500 Subject: [PATCH] Don't run main when flychecking. --- src/boot/boot.janet | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/boot/boot.janet b/src/boot/boot.janet index 4a465207..b24d2fb4 100644 --- a/src/boot/boot.janet +++ b/src/boot/boot.janet @@ -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) - (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))))) + (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)))))) (set i lenargs)))) (when (and (not *compile-only*) (or *should-repl* *no-file*))