Skip to content

Commit

Permalink
fix detection of opam root when no switch is selected
Browse files Browse the repository at this point in the history
fix #701
  • Loading branch information
Khady committed Jan 25, 2022
1 parent a5da5c6 commit a15d4f0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/opam.ml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ let make ?root () =
| Error _, _ -> Promise.return None
| Ok bin, Some root -> Promise.return (Some { bin; root })
| Ok bin, None -> (
let var_root_cmd = Cmd.Spawn (Cmd.append bin [ "var"; "root" ]) in
let var_root_cmd = Cmd.Spawn (Cmd.append bin [ "var"; "--global"; "root" ]) in
let+ var_root_output = Cmd.output var_root_cmd in
match var_root_output with
| Error _ -> None
Expand Down

0 comments on commit a15d4f0

Please sign in to comment.