Skip to content

Commit

Permalink
!fixup restore OCaml < 4.13 support
Browse files Browse the repository at this point in the history
  • Loading branch information
kit-ty-kate committed Oct 7, 2024
1 parent b568fd0 commit 3c9cad9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/core/opamStd.ml
Original file line number Diff line number Diff line change
Expand Up @@ -909,12 +909,17 @@ module OpamSys = struct
let args = Array.of_list (cmd :: args) in
let env = Env.raw_env () in
try
let path = split_path_variable (Env.get "PATH") in
let cmd =
List.find OpamStubs.is_executable
(List.map (fun d -> Filename.concat d cmd) path)
in
let (ic, _, _) as p = Unix.open_process_args_full cmd args env in
let r = input_line ic in
match Unix.close_process_full p with
| Unix.WEXITED 0 -> Some r
| WEXITED _ | WSIGNALED _ | WSTOPPED _ -> None
with Unix.Unix_error _ | Sys_error _ | End_of_file -> None
with Unix.Unix_error _ | Sys_error _ | End_of_file | Not_found -> None

let tty_out = Unix.isatty Unix.stdout

Expand Down

0 comments on commit 3c9cad9

Please sign in to comment.