@@ -1054,12 +1054,14 @@ process fn Execute
1054 (\e -> getIState >>= iRenderError . flip pprintErr e)
1054 (\e -> getIState >>= iRenderError . flip pprintErr e)
1055 where fc = fileFC "main"
1055 where fc = fileFC "main"
1056process fn (Compile codegen f)
1056process fn (Compile codegen f)
1057+ = if map toLower (takeExtension f) `elem` [".idr", ".idc"]
1058+ then runIO $ putStrLn ("Will not compile to " ++ f)
1057− = do (m, _) <- elabVal recinfo ERHS
1059+ else do (m, _) <- elabVal recinfo ERHS
1058− (PApp fc (PRef fc (sUN "run__IO"))
1060+ (PApp fc (PRef fc (sUN "run__IO"))
1059− [pexp $ PRef fc (sNS (sUN "main") ["Main"])])
1061+ [pexp $ PRef fc (sNS (sUN "main") ["Main"])])
1060− ir <- compile codegen f m
1062+ ir <- compile codegen f m
1061− i <- getIState
1063+ i <- getIState
1062− runIO $ generate codegen (head (idris_imported i)) ir
1064+ runIO $ generate codegen (head (idris_imported i)) ir
1063 where fc = fileFC "main"
1065 where fc = fileFC "main"
1064process fn (LogLvl i) = setLogLevel i
1066process fn (LogLvl i) = setLogLevel i
1065-- Elaborate as if LHS of a pattern (debug command)
1067-- Elaborate as if LHS of a pattern (debug command)