Do not remove sub-directories in `Compiler_utils.clean_dir'
This commit is contained in:
parent
95bb1a72ad
commit
8872bb3998
1 changed files with 4 additions and 1 deletions
|
@ -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
|
||||
in
|
||||
Array.iter rm_file_in_dir (Sys.readdir dir);
|
||||
end else Unix.mkdir dir 0o740;
|
||||
dir
|
||||
|
|
Loading…
Reference in a new issue