Skip to content

Commit

Permalink
feat: add regenerate_changelogs command
Browse files Browse the repository at this point in the history
  • Loading branch information
Boshen committed Apr 1, 2024
1 parent 0730ee9 commit 98b1157
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ pub enum ReleaseCommand {
#[bpaf(command)]
Update(#[bpaf(external(update_options))] UpdateOptions),

/// Regenerate CHANGELOG.md.
#[bpaf(command)]
RegenerateChangelogs(#[bpaf(external(update_options))] UpdateOptions),

#[bpaf(command)]
Publish(#[bpaf(external(publish_options))] PublishOptions),
}
3 changes: 3 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ fn main() -> Result<()> {
let command = release_command().fallback_to_usage().run();
match command {
ReleaseCommand::Update(options) => Update::new(options)?.run(),
ReleaseCommand::RegenerateChangelogs(options) => {
Update::new(options)?.regenerate_changelogs()
}
ReleaseCommand::Publish(options) => Publish::new(options).run(),
}
}
1 change: 0 additions & 1 deletion src/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ impl Update {
}

/// Regenerate the changelogs. Please change main.rs to use this.
#[allow(unused)]
pub fn regenerate_changelogs(&self) -> Result<()> {
for package in self.get_packages() {
let package_path = package.manifest_path.as_std_path().parent().unwrap();
Expand Down

0 comments on commit 98b1157

Please sign in to comment.