Skip to content

Commit 24145a7

Browse files
committed
tweak
1 parent 0d3f8af commit 24145a7

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

jscomp/main/cmij_main.ml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,14 @@ let stdlib = "stdlib-406"
134134
let (//) = Filename.concat
135135
let (|~) = Ext_string.contain_substring
136136

137+
let cmi_target_file = (Filename.concat "main" "builtin_cmi_datasets.ml")
137138
let release_cmi = Array.exists ((=) "-release") Sys.argv
138139
let () =
139-
if release_cmi then
140-
print_endline "collecting cmi from ../lib/ocaml in release mode"
141-
140+
if release_cmi then begin
141+
print_endline "collecting cmi from ../lib/ocaml in release mode" ;
142+
try Sys.remove cmi_target_file with _ ->
143+
Format.fprintf Format.err_formatter "failed to remove %s@." cmi_target_file
144+
end
142145
let () =
143146
let cmj_files =
144147
(
@@ -161,5 +164,5 @@ let () =
161164
in
162165
from_cmi
163166
cmi_files
164-
(Filename.concat "main" "builtin_cmi_datasets.ml")
167+
cmi_target_file
165168

0 commit comments

Comments
 (0)