Commit 8872bb39 authored by Nicolas Berthier's avatar Nicolas Berthier

Do not remove sub-directories in `Compiler_utils.clean_dir'

parent 95bb1a72
......@@ -107,7 +107,10 @@ let build_path suf =
let clean_dir dir =
if Sys.file_exists dir && Sys.is_directory dir
then begin
let rm_file_in_dir fn = Sys.remove (Filename.concat dir fn) in
let rm_file_in_dir fn =
let f = Filename.concat dir fn in
if not (Sys.is_directory f) then Sys.remove f
Array.iter rm_file_in_dir (Sys.readdir dir);
end else Unix.mkdir dir 0o740;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment