]> matita.cs.unibo.it Git - helm.git/blobdiff - matitaB/matita/matitaFilesystem.ml
Matitaweb: Bugfix for TeX-macro conversion.
[helm.git] / matitaB / matita / matitaFilesystem.ml
index 1ead03f9045ec9c78a6c9b3add4f6e4c2a351a7b..49091b2f5428cbd404cfbde0572999c147ea8d6e 100644 (file)
@@ -84,7 +84,7 @@ let html_of_library uid =
     let lpath filename = path ^ "/" ^ filename in
     let gpath filename = basedir ^ "/" ^ path ^ "/" ^ filename in
     let dirlist = 
-      List.filter (fun x -> String.sub x 0 1 = ".") 
+      List.filter (fun x -> String.sub x 0 1 <> ".") 
         (Array.to_list (Sys.readdir (basedir ^ "/" ^ path))) in
     let subdirs = List.filter (fun x -> Sys.is_directory (gpath x)) dirlist in
     let scripts = 
@@ -92,13 +92,14 @@ let html_of_library uid =
         try
           let i = String.rindex x '.' in
           let len = String.length x - i in
-          not (Sys.is_directory (gpath x)) && (String.sub x i len = ".ma")
+          not (Sys.is_directory (gpath x)) && 
+          (String.sub x 0 1 <> ".") && (String.sub x i len = ".ma")
         with Not_found | Invalid_argument _ -> false) dirlist in
     let subdirtags = 
       String.concat "\n" (List.map (fun x -> aux (lpath x)) subdirs) in
     let scripttags =
       String.concat "\n" 
-       (List.map (fun x -> leaf (gpath x)) scripts)
+       (List.map (fun x -> leaf (lpath x)) scripts)
     in
     branch path (subdirtags ^ "\n" ^ scripttags)
   in
@@ -107,3 +108,8 @@ let html_of_library uid =
   prerr_endline "BEGIN TREE";prerr_endline res;prerr_endline "END TREE";
   res
 ;;
+
+let reset_lib () =
+  let to_be_removed = (Helm_registry.get "matita.rt_base_dir") ^ "/users/*" in
+  ignore (Sys.command ("rm -rf " ^ to_be_removed))
+;;