Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
@@ -12,7 +12,7 @@ use cuddle_please_misc::{
|
||||
VcsClient,
|
||||
};
|
||||
use tracing::Level;
|
||||
use tracing_subscriber::{prelude::__tracing_subscriber_SubscriberExt, EnvFilter};
|
||||
use tracing_subscriber::{EnvFilter};
|
||||
|
||||
use crate::{
|
||||
config_command::{ConfigCommand, ConfigCommandHandler},
|
||||
|
@@ -52,7 +52,7 @@ impl ReleaseCommandHandler {
|
||||
tracing::trace!("found current version: {}", current_version.to_string());
|
||||
self.ui.write_str_ln(&format!(
|
||||
"found current version: {}",
|
||||
current_version.to_string()
|
||||
current_version
|
||||
));
|
||||
|
||||
let conventional_commit_results = parse_conventional_commits(current_version, commits)?;
|
||||
@@ -66,7 +66,7 @@ impl ReleaseCommandHandler {
|
||||
let (commit_strs, next_version) = conventional_commit_results.unwrap();
|
||||
self.ui.write_str_ln(&format!(
|
||||
"calculated next version: {}",
|
||||
next_version.to_string()
|
||||
next_version
|
||||
));
|
||||
|
||||
tracing::trace!("creating changelog");
|
||||
@@ -112,7 +112,7 @@ impl ReleaseCommandHandler {
|
||||
next_version: &Version,
|
||||
changelog_last_changes: Option<String>,
|
||||
) -> Result<(), anyhow::Error> {
|
||||
Ok(if !dry_run {
|
||||
if !dry_run {
|
||||
self.gitea_client.create_release(
|
||||
owner,
|
||||
repository,
|
||||
@@ -122,7 +122,8 @@ impl ReleaseCommandHandler {
|
||||
)?;
|
||||
} else {
|
||||
tracing::debug!("creating release (dry_run)");
|
||||
})
|
||||
};
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn create_pull_request(
|
||||
@@ -202,7 +203,7 @@ impl ReleaseCommandHandler {
|
||||
) -> Result<Option<Tag>, anyhow::Error> {
|
||||
let tags = self.gitea_client.get_tags(owner, repository)?;
|
||||
let significant_tag = get_most_significant_version(tags.iter().collect());
|
||||
Ok(significant_tag.map(|t| t.clone()))
|
||||
Ok(significant_tag.cloned())
|
||||
}
|
||||
|
||||
fn check_git_remote_connection(
|
||||
@@ -252,8 +253,8 @@ fn parse_conventional_commits(
|
||||
}
|
||||
|
||||
fn get_current_version(significant_tag: Option<Tag>) -> Version {
|
||||
let current_version = significant_tag
|
||||
|
||||
significant_tag
|
||||
.map(|st| Version::try_from(st).unwrap())
|
||||
.unwrap_or(Version::new(0, 0, 0));
|
||||
current_version
|
||||
.unwrap_or(Version::new(0, 0, 0))
|
||||
}
|
||||
|
Reference in New Issue
Block a user