Skip to content

Commit 790b5fb

Browse files
committed
make color default to always
1 parent 8cbaa39 commit 790b5fb

File tree

3 files changed

+17
-13
lines changed

3 files changed

+17
-13
lines changed

jscomp/bsb/bsb_ninja_rule.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ let make_custom_rules
129129
~is_dev
130130
~postbuild : string =
131131
Ext_buffer.clear buf;
132-
Ext_buffer.add_string buf "$bsc -color always";
132+
Ext_buffer.add_string buf "$bsc";
133133
Ext_buffer.add_ninja_prefix_var buf Bsb_ninja_global_vars.g_pkg_flg;
134134
if bs_suffix then
135135
Ext_buffer.add_string buf " -bs-suffix";
@@ -152,7 +152,7 @@ let make_custom_rules
152152
in
153153
let mk_ast ~(has_pp : bool) ~has_ppx ~has_reason_react_jsx : string =
154154
Ext_buffer.clear buf ;
155-
Ext_buffer.add_string buf "$bsc $warnings -color always";
155+
Ext_buffer.add_string buf "$bsc $warnings";
156156
(match refmt with
157157
| None -> ()
158158
| Some x ->

jscomp/core/bs_conditional_initial.ml

+2-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ let setup_env () =
3636
Clflags.compile_only := true;
3737
Config.bs_only := true;
3838
Clflags.no_implicit_current_dir := true;
39-
(* default true
39+
Clflags.color := Some Always;
40+
(* default true
4041
otherwise [bsc -I sc src/hello.ml ] will include current directory to search path
4142
*)
4243
Clflags.assume_no_mli := Clflags.Mli_non_exists;

jscomp/main/js_main.ml

+13-10
Original file line numberDiff line numberDiff line change
@@ -302,16 +302,6 @@ let buckle_script_flags : (string * Bsc_args.spec * string) array =
302302
"-o", string_optional_set Clflags.output_name,
303303
"<file> set output file name to <file>";
304304

305-
"-color", string_call set_color_option,
306-
"Enable or disable colors in compiler messages\n\
307-
The following settings are supported:\n\
308-
auto use heuristics to enable colors only if supported\n\
309-
always enable colors\n\
310-
never disable colors\n\
311-
The default setting is 'auto', and the current heuristic\n\
312-
checks that the TERM environment variable exists and is\n\
313-
not empty or \"dumb\", and that isatty(stderr) holds.";
314-
315305
"-bs-read-cmi", unit_call (fun _ -> Clflags.assume_no_mli := Mli_exists),
316306
"*internal* Assume mli always exist ";
317307

@@ -357,6 +347,8 @@ let buckle_script_flags : (string * Bsc_args.spec * string) array =
357347
"*internal* Pass gentype command";
358348

359349
(******************************************************************************)
350+
351+
360352
"-bs-super-errors", unit_lazy Super_main.setup,
361353
"Better error message combined with other tools ";
362354

@@ -381,6 +373,17 @@ let buckle_script_flags : (string * Bsc_args.spec * string) array =
381373
"-bs-internal-check", unit_call Bs_cmi_load.check,
382374
"*internal* Built in check corrupted data";
383375

376+
"-color", string_call set_color_option,
377+
"Enable or disable colors in compiler messages\n\
378+
The following settings are supported:\n\
379+
auto use heuristics to enable colors only if supported\n\
380+
always enable colors\n\
381+
never disable colors\n\
382+
The default setting is 'always'\n\
383+
The current heuristic for 'auto'\n\
384+
checks that the TERM environment variable exists and is\n\
385+
not empty or \"dumb\", and that isatty(stderr) holds.";
386+
384387
"-bs-list-conditionals", unit_call (fun () -> Lexer.list_variables Format.err_formatter),
385388
"List existing conditional variables";
386389

0 commit comments

Comments
 (0)