Explorar o código

Minifier now checks oif input files exist

Taddeus Kroes %!s(int64=11) %!d(string=hai) anos
pai
achega
35720c3acc
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      main.ml

+ 2 - 0
main.ml

@@ -104,6 +104,8 @@ let parse_files = function
     let rec loop = function
       | [] -> []
       | filename :: tl ->
+        if not (Sys.file_exists filename) then
+          raise (Failure ("file " ^ filename ^ " does not exist"));
         let input = Util.input_all (open_in filename) in
         let stylesheet = Parse.parse_input filename input in
         (input, stylesheet) :: loop tl