- 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 opt_exit =
+ function
+ None -> ()
+ | Some n -> exit n
+ in
+ match !status with
+ None -> opt_exit n
+ | Some status ->
+ try
+ let baseuri = MatitaTypes.get_string_option !status "baseuri" in
+ MatitacleanLib.clean_baseuris ~verbose:false [baseuri];
+ opt_exit n
+ with MatitaTypes.Option_error("baseuri", "not found") ->
+ (* no baseuri ==> nothing to clean yet *)
+ opt_exit n