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

opam switch create: better handling of already present local switch #6163

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rjbou
Copy link
Collaborator

@rjbou rjbou commented Aug 20, 2024

No description provided.

@rjbou rjbou added the PR: WIP Not for merge at this stage label Aug 20, 2024
Comment on lines +302 to +311
if not (OpamFilename.dir_is_empty comp_dir) then
OpamConsole.error_and_exit `Bad_arguments
"Directory %S already exists, please choose a different name"
(OpamFilename.Dir.to_string comp_dir)
else
if not (OpamConsole.confirm
"Directory %S exitst and is empty, remove it?") then
OpamConsole.error_and_exit `Aborted "Remove %S directory and recreate switch"
else
let gt, st =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if not (OpamFilename.dir_is_empty comp_dir) then
OpamConsole.error_and_exit `Bad_arguments
"Directory %S already exists, please choose a different name"
(OpamFilename.Dir.to_string comp_dir)
else
if not (OpamConsole.confirm
"Directory %S exitst and is empty, remove it?") then
OpamConsole.error_and_exit `Aborted "Remove %S directory and recreate switch"
else
let gt, st =
if not (OpamFilename.dir_is_empty comp_dir) then
OpamConsole.error_and_exit `Bad_arguments
"Directory %S already exists, please choose a different name"
(OpamFilename.Dir.to_string comp_dir)
else if not (OpamConsole.confirm
"Directory %S exists and is empty, remove it?") then
OpamConsole.error_and_exit `Aborted "Remove %S directory and recreate switch"
else
let gt, st =

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: WIP Not for merge at this stage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants