Skip to content

Commit

Permalink
Simplify apply_rewriter args
Browse files Browse the repository at this point in the history
  • Loading branch information
3Rafal committed Apr 21, 2023
1 parent 2f23f0d commit 3df2020
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/ocaml/driver/pparse.ml
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,13 @@ let merlin_system_command ~prog ~args ~cwd =
let apply_rewriter magic ppx (fn_in, failures) =
let title = "apply_rewriter" in
let fn_out = Filename.temp_file "camlppx" "" in
let args = [
Filename.quote fn_in;
Printf.sprintf "%s%s"
(Filename.quote fn_out)
(if Sys.win32 then "" else " 1>&2")
] in
let args =
let redirect =
if Sys.win32 then [] else ["1>&2"] in
Filename.quote fn_in
:: Filename.quote fn_out
:: redirect
in
let comm = commandline ppx.workval args in
log ~title "running %s from directory %S" comm ppx.workdir;
Logger.log_flush ();
Expand Down

0 comments on commit 3df2020

Please sign in to comment.