Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix opam init -yn asking questions on Windows #6033

Merged
merged 2 commits into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions master_changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ users)
## Plugins

## Init
* Provide defaults so `opam init -y` no longer asks questions [#6033 @dra27 fix #6013]

## Config report

Expand Down
10 changes: 5 additions & 5 deletions src/client/opamClient.ml
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,7 @@ let git_for_windows kind mechanism cygwin_is_tweakable =
let prompt () =
OpamStd.Option.iter (OpamConsole.warning "%s\n") gfw_message;
OpamConsole.menu "Which Git should opam use?"
~default ~no:default ~options
~default ~yes:default ~no:default ~options
in
match prompt () with
| `Default -> None, cygwin_is_tweakable
Expand Down Expand Up @@ -1155,7 +1155,7 @@ let rec cygwin_menu ~bypass_checks header =
order to operate correctly. At present, this requires the installation \
of Cygwin to provide these tools.\n\n";
match OpamConsole.menu "How should opam obtain Unix tools?"
~default ~no:default ~options with
~default ~yes:default ~no:default ~options with
| `Chosen (kind, `Internal) ->
assert (kind = `Cygwin);
Some (kind, `Internal OpamInitDefaults.required_packages_for_cygwin)
Expand Down Expand Up @@ -1233,7 +1233,7 @@ let initialise_msys2 root =
in
let answer =
let cmd = OpamConsole.colorise `yellow (cmd ^ " -lc \"uname -a\"") in
OpamConsole.menu ~unsafe_yes:`Yes ~default:`Yes ~no:`Quit
OpamConsole.menu ~default:`Yes ~unsafe_yes:`Yes ~yes:`Ignore ~no:`Quit
"MSYS2 appears not to have been initialised. opam can:"
~options:[
`Yes, Printf.sprintf
Expand Down Expand Up @@ -1728,8 +1728,8 @@ let get_redirected_root () =
OpamStd.Option.replace check (OpamConsole.read "Root directory for opam: ")
in
let rec menu () =
match OpamConsole.menu "Where should opam store files?" ~default ~options
~no:default with
match OpamConsole.menu "Where should opam store files?" ~options
~default ~yes:default ~no:default with
| `Redirect ->
Some None
| `Endure ->
Expand Down
Loading