Skip to content

Commit

Permalink
Don't ask confirmation when pinning a new package
Browse files Browse the repository at this point in the history
  • Loading branch information
kit-ty-kate committed Nov 30, 2024
1 parent 3a11680 commit 63bdee5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
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"
(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

0 comments on commit 63bdee5

Please sign in to comment.