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