Skip to content

Commit

Permalink
better integration with vscode
Browse files Browse the repository at this point in the history
  • Loading branch information
bobzhang committed Mar 22, 2019
1 parent 5d690c5 commit b79f844
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 7 additions & 3 deletions bin/main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -169,15 +169,19 @@ let default =
; `Blocks Common.help_secs
])

let error_exit () =
prerr_endline "DUNE BUILD FAILED";
exit 1
let main () =
Colors.setup_err_formatter_colors ();
try
match Term.eval_choice default all ~catch:false with
| `Error _ -> exit 1
| `Error _ ->
error_exit ()
| _ -> exit 0
with
| Fiber.Never -> exit 1
| Fiber.Never -> error_exit ()
| exn ->
let exn = Exn_with_backtrace.capture exn in
Report_error.report exn;
exit 1
error_exit ()
2 changes: 2 additions & 0 deletions src/scheduler.ml
Original file line number Diff line number Diff line change
Expand Up @@ -739,6 +739,7 @@ let poll ?log ?config ~once ~finally () =
Exit
in
let wait msg =
Format.fprintf Format.err_formatter "@.Finish building@.";
let old_generator = Console.get_status_line_generator () in
set_status_line_generator
(fun () ->
Expand All @@ -750,6 +751,7 @@ let poll ?log ?config ~once ~finally () =
res
in
let rec loop () =
Format.fprintf Format.err_formatter "@.Start building@.";
let res = Run_once.run_and_cleanup t once in
finally ();
match res with
Expand Down

0 comments on commit b79f844

Please sign in to comment.