File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed
Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -371,7 +371,7 @@ let run_command opts cmd =
371371let opam_command cmd =
372372 match get_opam_path_opt () with
373373 | Some s -> s ^ " exec -- " ^ cmd
374- | None -> " opam exec -- " ^ cmd
374+ | None -> cmd
375375
376376let execute opts cmd =
377377 let status, out, err = execute cmd in
@@ -706,12 +706,17 @@ let decompose_argument env sigma c =
706706
707707let set_opam_env opts =
708708 let path = Unix. getenv " PATH" in
709- let opam_path =
710- match get_opam_path_opt () with
711- | Some s -> s
712- | None -> run_command opts " which opam"
709+ let opam_binpath =
710+ match Unix. getenv " OPAM_SWITCH_PREFIX" with
711+ | exception Not_found ->
712+ let opam_path =
713+ match get_opam_path_opt () with
714+ | Some s -> s
715+ | None -> run_command opts " which opam"
716+ in
717+ run_command opts (opam_path ^ " var --safe bin" )
718+ | pref -> pref ^ " /bin"
713719 in
714- let opam_binpath = run_command opts (opam_path ^ " var --safe bin" ) in
715720 Unix. putenv " PATH" (opam_binpath ^ " :" ^ path)
716721
717722let extract_and_run
You can’t perform that action at this time.
0 commit comments