1
1
(* Copyright (C) 2017 Authors of BuckleScript
2
- *
2
+ *
3
3
* This program is free software: you can redistribute it and/or modify
4
4
* it under the terms of the GNU Lesser General Public License as published by
5
5
* the Free Software Foundation, either version 3 of the License, or
17
17
* but WITHOUT ANY WARRANTY; without even the implied warranty of
18
18
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
19
* GNU Lesser General Public License for more details.
20
- *
20
+ *
21
21
* You should have received a copy of the GNU Lesser General Public License
22
22
* along with this program; if not, write to the Free Software
23
23
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
26
26
let (// ) = Ext_path. combine
27
27
28
28
29
- let ninja_clean bsc_dir proj_dir =
30
- try
31
- let cmd = bsc_dir // " ninja.exe" in
32
- let cwd = proj_dir // Bsb_config. lib_bs in
33
- if Sys. file_exists cwd then
34
- let eid =
29
+ let ninja_clean bsc_dir proj_dir =
30
+ try
31
+ let cmd = bsc_dir // " ninja.exe" in
32
+ let cwd = proj_dir // Bsb_config. lib_bs in
33
+ if Sys. file_exists cwd then
34
+ let eid =
35
35
Bsb_unix. run_command_execv {cmd ; args = [|cmd; " -t" ; " clean" |] ; cwd} in
36
- if eid <> 0 then
36
+ if eid <> 0 then
37
37
Bsb_log. warn " @{<warning>ninja clean failed@}@."
38
- with e ->
38
+ with e ->
39
39
Bsb_log. warn " @{<warning>ninja clean failed@} : %s @." (Printexc. to_string e)
40
40
41
41
let clean_bs_garbage bsc_dir proj_dir =
42
- Bsb_log. info " @{<info>Cleaning:@} in %s@." proj_dir ;
42
+ Bsb_log. info " @{<info>Cleaning:@} in %s@." proj_dir ;
43
43
let try_remove x =
44
44
let x = proj_dir // x in
45
45
if Sys. file_exists x then
46
46
Bsb_unix. remove_dir_recursive x in
47
- try
47
+ try
48
48
Bsb_parse_sources. clean_re_js proj_dir; (* clean re.js files*)
49
- ninja_clean bsc_dir proj_dir ;
50
- List. iter try_remove Bsb_config. all_lib_artifacts;
49
+ ninja_clean bsc_dir proj_dir ;
50
+ List. iter try_remove Bsb_config. all_lib_artifacts;
51
51
with
52
52
e ->
53
53
Bsb_log. warn " @{<warning>Failed@} to clean due to %s" (Printexc. to_string e)
@@ -59,4 +59,4 @@ let clean_bs_deps bsc_dir proj_dir =
59
59
clean_bs_garbage bsc_dir pkg_cxt.cwd
60
60
)
61
61
62
- let clean_self bsc_dir proj_dir = clean_bs_garbage bsc_dir proj_dir
62
+ let clean_self bsc_dir proj_dir = clean_bs_garbage bsc_dir proj_dir
0 commit comments