Sys.catch_break true;
interactive_loop ()
+let clean_exit n =
+ match !status with
+ None -> exit n
+ | Some status ->
+ let baseuri = MatitaTypes.get_string_option !status "baseuri" in
+ MatitacleanLib.clean_baseuris ~verbose:false [baseuri];
+ exit n
+
+let dump_moo_to_file file moo =
+ let os = open_out (MatitaMisc.obj_file_of_script file) in
+ let output s = output_string os s in
+ output "(* GENERATED FILE: DO NOT EDIT! *)\n\n";
+ List.iter output (List.rev moo);
+ close_out os
+
let main ~mode =
Helm_registry.load_from "matita.conf.xml";
Http_getter.init ();
end
else
begin
- let os = open_out (MatitaMisc.obj_file_of_script fname) in
- let output s = output_string os s in
- output "(* GENERATED FILE: DO NOT EDIT! *)\n\n";
- List.iter output (List.rev moo_content_rev);
- close_out os;
+ dump_moo_to_file fname moo_content_rev;
MatitaLog.message
(sprintf "execution of %s completed in %s." fname (hou^min^sec));
exit 0
(** go initializes the status and calls interactive_loop *)
val go : unit -> unit
val main : mode:[ `COMPILER | `TOPLEVEL ] -> unit
+val dump_moo_to_file: string -> string list -> unit
(** clean_exit n
performs an exit [n] after a complete clean-up of what was partially compiled