-
Notifications
You must be signed in to change notification settings - Fork 371
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
opam var
and opam option
fixes when no switch is installed
#5027
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
As a side note, it might be a good idea to remove OpamStateConfig.get_switch
in the future. It looks like its design brings issues such as this fairly easily (If i understand what the issue was correctly)
Not really, |
opam var
and opam option
fixesopam var
and opam option
fixes when no switch is installed
0c93862
to
8fe1d4f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to merge.
Remark: the ~no_switch
flag is defined but never used.
instead of writing an inconsistent switch-config file
…termine the scope also by checking switch selection
Certainly a kept old implementation, it is not needed. let with_switch ~display gt lock_kind ?no_switch st k =
match st with
| Some st -> k st.switch st.switch_config
| None ->
match OpamStateConfig.get_switch_opt () with
| None ->
(match no_switch with
| None ->
OpamConsole.error_and_exit `Configuration_error "No switch selected"
| Some no_switch ->
no_switch (OpamSwitch.of_string "no-switch")
OpamFile.Switch_config.empty) |
`opam var` and `opam option` fixes when no switch is installed
--switch <sw>
fails instead of writing a wrongswitch-config
filethe second point need to be backported to 2.1.3