Skip to content

Commit

Permalink
Remove bistro subcommand and rename
Browse files Browse the repository at this point in the history
Closes #241.
  • Loading branch information
Leonidas-from-XIV committed Mar 2, 2022
1 parent c66c13e commit e8bdf56
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 108 deletions.
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
- Removed support for the OPAM 1.2.2 client. This means `dune-release` expects
the `opam` binary to be version 2.0 at least. (#406, #411,
@Leonidas-from-XIV)
- Removed `bistro` subcommand, it is equivalent to calling `dune-release`
without arguments (#241, #392, @Leonidas-from-XIV)

### Security

Expand Down
77 changes: 0 additions & 77 deletions bin/bistro.ml

This file was deleted.

26 changes: 0 additions & 26 deletions bin/bistro.mli

This file was deleted.

43 changes: 38 additions & 5 deletions bin/main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
%%NAME%% %%VERSION%%
---------------------------------------------------------------------------*)

open Bos_setup.R.Infix
open Cmdliner

let cmds =
Expand All @@ -13,7 +14,6 @@ let cmds =
Publish.cmd;
Opam.cmd;
Help.cmd;
Bistro.cmd;
Lint.cmd;
Check.cmd;
Delegate_info.cmd;
Expand All @@ -31,9 +31,13 @@ let man =
[
`S Manpage.s_description;
`P "$(mname) releases dune packages to opam.";
`P
"Without arguments, $(mname) acts like $(b,dune-release bistro): refer \
to $(b,dune-release help bistro) for help about the default behavior.";
`P "The $(mname) command is equivalent to the invokation of:";
`Pre
"dune-release distrib # Create the distribution archive\n\
dune-release publish # Publish it on the WWW with its documentation\n\
dune-release opam pkg # Create an opam package\n\
dune-release opam submit # Submit it to OCaml's opam repository";
`P "See dune-release(7) for more information.";
`P "Use '$(mname) help release' for help to release a package.";
`Noblank;
`P "Use '$(mname) help troubleshoot' for a few troubleshooting tips.";
Expand All @@ -45,8 +49,37 @@ let man =
`P "Daniel C. Buenzli, $(i,http://erratique.ch)";
]

(* Only carry on when the first operation returns 0 *)
let ( >! ) x f = match x with Ok 0 -> f () | _ -> x

let auto () (`Dry_run dry_run) (`Package_names pkg_names)
(`Package_version version) (`Dist_tag tag) (`Keep_v keep_v) (`Token token)
(`Include_submodules include_submodules) (`Draft draft)
(`Local_repo local_repo) (`Remote_repo remote_repo) (`Opam_repo opam_repo)
(`No_auto_open no_auto_open) =
Cli.handle_error
( Dune_release.Config.token ~token ~dry_run () >>= fun token ->
let token = Dune_release.Config.Cli.make token in
Distrib.distrib ~dry_run ~pkg_names ~version ~tag ~keep_v ~keep_dir:false
~skip_lint:false ~skip_build:false ~skip_tests:false ~include_submodules
()
>! fun () ->
Publish.publish ~token ~pkg_names ~version ~tag ~keep_v ~dry_run
~publish_artefacts:[] ~yes:false ~draft ()
>! fun () ->
Opam.get_pkgs ~dry_run ~keep_v ~tag ~pkg_names ~version () >>= fun pkgs ->
Opam.pkg ~dry_run ~pkgs () >! fun () ->
Opam.submit ~token ~dry_run ~pkgs ~pkg_names ~no_auto_open ~yes:false
~draft () ?local_repo ?remote_repo ?opam_repo )

let term =
Term.(
const auto $ Cli.setup $ Cli.dry_run $ Cli.pkg_names $ Cli.pkg_version
$ Cli.dist_tag $ Cli.keep_v $ Cli.token $ Cli.include_submodules $ Cli.draft
$ Cli.local_repo $ Cli.remote_repo $ Cli.opam_repo $ Cli.no_auto_open)

let main =
Cmd.group ~default:Bistro.term
Cmd.group ~default:term
(Cmd.info "dune-release" ~version:"%%VERSION%%" ~doc ~sdocs ~exits ~man)
cmds

Expand Down

0 comments on commit e8bdf56

Please sign in to comment.