Small refactoring to call Path.absolute one less time

This commit is contained in:
Rudi Grinberg 2018-05-03 21:28:32 +07:00
parent 46d74e1a96
commit 92b351de30
1 changed files with 4 additions and 6 deletions

View File

@ -149,11 +149,9 @@ let create ~(kind : Kind.t) ~path ~env ~name ~merlin ~targets ~profile () =
the contents of the variable, but "ocamlfind printconf conf"
still prints the configuration file set at the configuration
time of ocamlfind, sigh... *)
match Env.get env "OCAMLFIND_CONF" with
| Some s -> Fiber.return (Path.absolute s)
| None ->
Process.run_capture_line ~env Strict
fn ["printconf"; "conf"]
(match Env.get env "OCAMLFIND_CONF" with
| Some s -> Fiber.return s
| None -> Process.run_capture_line ~env Strict fn ["printconf"; "conf"])
>>| Path.absolute)
in