24
24
25
25
26
26
27
- let cwd = Sys. getcwd ()
28
- let bsc_dir = Bsb_build_util. get_bsc_dir ~cwd
29
27
let () = Bsb_log. setup ()
30
28
let (// ) = Ext_path. combine
31
29
let force_regenerate = ref false
@@ -57,10 +55,10 @@ let bsb_main_flags : (string * Arg.spec * string) list=
57
55
" -w" , Arg. Set watch_mode,
58
56
" Watch mode" ;
59
57
" -clean-world" , Arg. Unit (fun _ ->
60
- Bsb_clean. clean_bs_deps bsc_dir cwd),
58
+ Bsb_clean. clean_bs_deps Bsb_global_paths. cwd),
61
59
" Clean all bs dependencies" ;
62
60
" -clean" , Arg. Unit (fun _ ->
63
- Bsb_clean. clean_self bsc_dir cwd),
61
+ Bsb_clean. clean_self Bsb_global_paths. cwd),
64
62
" Clean only current project" ;
65
63
" -make-world" , Arg. Unit set_make_world,
66
64
" Build all dependencies and itself " ;
@@ -136,14 +134,14 @@ let program_exit () =
136
134
(* see discussion #929, if we catch the exception, we don't have stacktrace... *)
137
135
let () =
138
136
139
- let vendor_ninja = bsc_dir // " ninja.exe " in
137
+ let vendor_ninja = Bsb_global_paths. vendor_ninja in
140
138
try begin
141
139
match Sys. argv with
142
140
| [| _ |] -> (* specialize this path [bsb.exe] which is used in watcher *)
143
141
Bsb_ninja_regen. regenerate_ninja
144
142
~toplevel_package_specs: None
145
143
~forced: false
146
- ~cwd ~bsc_dir |> ignore;
144
+ ~cwd: Bsb_global_paths. cwd |> ignore;
147
145
ninja_command_exit vendor_ninja [||]
148
146
149
147
| argv ->
@@ -155,7 +153,7 @@ let () =
155
153
Arg. parse bsb_main_flags handle_anonymous_arg usage;
156
154
(* first, check whether we're in boilerplate generation mode, aka -init foo -theme bar *)
157
155
match ! generate_theme_with_path with
158
- | Some path -> Bsb_theme_init. init_sample_project ~cwd ~theme: ! current_theme path
156
+ | Some path -> Bsb_theme_init. init_sample_project ~cwd: Bsb_global_paths. cwd ~theme: ! current_theme path
159
157
| None ->
160
158
(* [-make-world] should never be combined with [-package-specs] *)
161
159
let make_world = ! make_world in
@@ -172,9 +170,9 @@ let () =
172
170
(let config_opt =
173
171
Bsb_ninja_regen. regenerate_ninja
174
172
~toplevel_package_specs: None
175
- ~forced: force_regenerate ~cwd ~bsc_dir in
173
+ ~forced: force_regenerate ~cwd: Bsb_global_paths. cwd in
176
174
if make_world then begin
177
- Bsb_world. make_world_deps cwd config_opt [||]
175
+ Bsb_world. make_world_deps Bsb_global_paths. cwd config_opt [||]
178
176
end ;
179
177
if ! watch_mode then begin
180
178
program_exit ()
@@ -194,11 +192,11 @@ let () =
194
192
let config_opt =
195
193
Bsb_ninja_regen. regenerate_ninja
196
194
~toplevel_package_specs: None
197
- ~cwd ~bsc_dir
195
+ ~cwd: Bsb_global_paths. cwd
198
196
~forced: ! force_regenerate in
199
197
(* [-make-world] should never be combined with [-package-specs] *)
200
198
if ! make_world then
201
- Bsb_world. make_world_deps cwd config_opt ninja_args;
199
+ Bsb_world. make_world_deps Bsb_global_paths. cwd config_opt ninja_args;
202
200
if ! watch_mode then program_exit ()
203
201
else ninja_command_exit vendor_ninja ninja_args
204
202
end
0 commit comments