-
Notifications
You must be signed in to change notification settings - Fork 74
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
Modified the command to set the --set-switch
flag
#744
Modified the command to set the --set-switch
flag
#744
Conversation
|
With
|
src/opam.ml
Outdated
let switch_arg switch = ["--switch=" ^ Switch.name switch; "--set-switch"] | ||
|
||
let exec t switch ~args = spawn t ("exec" :: switch_arg switch :: "--" :: args) | ||
let exec t switch ~args = spawn t (("exec" :: switch_arg switch) @ ("--" :: args)) |
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.
the --set-switch
flag is only needed on the calls to opam exec
. So switch_arg
doesn't need to be modified
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.
You mean I pass the --set-switch
flag to only the exec
function and remove it from the switch_arg
?
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.
Yes. Basically the whole PR will become
- let exec t switch ~args = spawn t ("exec" :: switch_arg switch :: "--" :: args)
+ let exec t switch ~args = spawn t ("exec" :: switch_arg switch :: "--set-switch" :: "--" :: args)
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.
Thanks! Made the corrections.
src/opam.ml
Outdated
spawn t (("install" :: switch_arg switch) @ ("-y" :: packages)) | ||
|
||
let update t switch = spawn t [ "update"; switch_arg switch ] | ||
let update t switch = spawn t [ "update"; switch_arg switch ] @ ["--switch=" ^ Switch.name switch; "--set-switch"] | ||
|
||
let upgrade t switch = spawn t [ "upgrade"; switch_arg switch; "-y" ] | ||
let upgrade t switch = spawn t [ "upgrade"; switch_arg switch; "-y" ] @ ["--switch=" ^ Switch.name switch; "--set-switch"] | ||
|
||
let remove t switch packages = | ||
spawn t ("remove" :: switch_arg switch :: "-y" :: packages) | ||
spawn t (("remove" :: switch_arg switch) @ ("-y" :: packages)) |
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.
there's already switch_arg switch
so you don't need to insert ["--switch=" ^ Switch.name switch; "--set-switch"]
again. But actually for all those commands there's no use for --set-switch
so this part of the diff can be removed.
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.
Noted!
I'm not part of the team, so won't be the one validating your work. But thank you for the contribution! |
Thanks for the work @SaySayo and the review @Khady 🙂 This looks good to me, but @ulugbekna could you confirm that this is the expected fix for #655? |
3562d78
to
3595a3b
Compare
3595a3b
to
a4e0d05
Compare
Thanks, @SaySayo ! :-) |
Modified the command to set the
--set-switch
flag. Fixes (#655). @tmattio @mnxn please review