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

Don't ask confirmation when pinning a new package #6309

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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 @@ -43,6 +43,7 @@ users)
## Config

## Pin
* Don't ask confirmation when pinning an unknown package (absent from repositories) [#6309 @kit-ty-kate]

## List

Expand Down
9 changes: 3 additions & 6 deletions src/client/opamPinCommand.ml
Original file line number Diff line number Diff line change
Expand Up @@ -491,12 +491,9 @@ and source_pin
version, None
in

if not (OpamPackage.has_name st.packages name) &&
not (OpamConsole.confirm
"Package %s does not exist, create as a %s package?"
(OpamPackage.Name.to_string name)
(OpamConsole.colorise `bold "NEW"))
then raise Aborted;
if not (OpamPackage.has_name st.packages name) then
OpamConsole.note "Package %s was unknown until now"
Copy link
Member Author

Choose a reason for hiding this comment

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

If anyone has a better idea feel free to change it

(OpamPackage.Name.to_string name);

(match OpamStd.Option.map OpamFile.URL.url cur_urlf, target_url with
| Some u, Some target when OpamUrl.(
Expand Down