chore(release): 0.1.0 (#6)
### Added - add docker setup - refactor frontend configuration - with all the way through - with create pull request and release - with gitea - with prepend as well - add cliff - remove tokio - with doctor - with git client - with fixes - with conventional parse - with tags command - add semver - can get commit chain - with start of environment engine - with gitea client - fmt - add gitea client stub - add tests for git setup - split headings into local and global - rename to cuddle_please - add config parsing - with basic get dir - add mkdocs - add base ### Other - remove old changelog - *(deps)* update all dependencies (#2) - *(release)* 0.0.1 (#4) - release command - add cuddle.release to this repository - add granular docker setup - fix checks - chck refactor commands - move doctor command - fmt - rename release command - move gitea command into its own file - move config list - move gitea out of the way - move config building out of main execution loop - move commands and misc out of main binary package - fmt - check hide commands - move cuddle-please to cuddle-please release - remove no-vcs option (moved to a later stage if github is someday adopted - fix clippy warnings - clippy fix - fix - cleanup Reviewed-on: #6 Co-authored-by: kjuulh <contact@kjuulh.io> Co-committed-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
@@ -52,6 +52,24 @@ pub struct ConfigArgs {
|
||||
help_heading = "Config"
|
||||
)]
|
||||
pub branch: Option<String>,
|
||||
|
||||
/// which git username to use for commits
|
||||
#[arg(
|
||||
env = "CUDDLE_PLEASE_GIT_USERNAME",
|
||||
long,
|
||||
global = true,
|
||||
help_heading = "Config"
|
||||
)]
|
||||
pub git_username: Option<String>,
|
||||
|
||||
/// which git email to use for commits
|
||||
#[arg(
|
||||
env = "CUDDLE_PLEASE_GIT_EMAIL",
|
||||
long,
|
||||
global = true,
|
||||
help_heading = "Config"
|
||||
)]
|
||||
pub git_email: Option<String>,
|
||||
}
|
||||
|
||||
impl From<ConfigArgs> for PleaseConfigBuilder {
|
||||
@@ -65,6 +83,8 @@ impl From<ConfigArgs> for PleaseConfigBuilder {
|
||||
}),
|
||||
settings: Some(PleaseSettingsConfigBuilder {
|
||||
api_url: value.api_url,
|
||||
git_username: value.git_username,
|
||||
git_email: value.git_email,
|
||||
}),
|
||||
}
|
||||
}
|
||||
|
@@ -19,6 +19,8 @@ pub struct PleaseProjectConfig {
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct PleaseSettingsConfig {
|
||||
pub api_url: String,
|
||||
pub git_username: Option<String>,
|
||||
pub git_email: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
@@ -43,6 +45,12 @@ impl PleaseConfig {
|
||||
pub fn get_api_url(&self) -> &str {
|
||||
&self.settings.api_url
|
||||
}
|
||||
pub fn get_git_username(&self) -> Option<String> {
|
||||
self.settings.git_username.clone()
|
||||
}
|
||||
pub fn get_git_email(&self) -> Option<String> {
|
||||
self.settings.git_email.clone()
|
||||
}
|
||||
}
|
||||
|
||||
impl Display for PleaseConfig {
|
||||
@@ -52,6 +60,12 @@ impl Display for PleaseConfig {
|
||||
writeln!(f, " repository: {}", self.get_repository())?;
|
||||
writeln!(f, " branch: {}", self.get_branch())?;
|
||||
writeln!(f, " api_url: {}", self.get_api_url())?;
|
||||
if let Some(git_username) = self.get_git_username() {
|
||||
writeln!(f, " git_username: {}", git_username)?;
|
||||
}
|
||||
if let Some(git_email) = self.get_git_email() {
|
||||
writeln!(f, " git_email: {}", git_email)?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
@@ -15,6 +15,8 @@ pub struct PleaseProjectConfigBuilder {
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
|
||||
pub struct PleaseSettingsConfigBuilder {
|
||||
pub api_url: Option<String>,
|
||||
pub git_username: Option<String>,
|
||||
pub git_email: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
|
||||
@@ -56,6 +58,13 @@ impl PleaseConfigBuilder {
|
||||
fsettings.api_url = Some(api_url);
|
||||
}
|
||||
|
||||
if let Some(git_username) = settings.git_username {
|
||||
fsettings.git_username = Some(git_username);
|
||||
}
|
||||
if let Some(git_email) = settings.git_email {
|
||||
fsettings.git_email = Some(git_email);
|
||||
}
|
||||
|
||||
self.settings = Some(fsettings);
|
||||
}
|
||||
|
||||
@@ -99,6 +108,8 @@ impl TryFrom<PleaseSettingsConfigBuilder> for PleaseSettingsConfig {
|
||||
fn try_from(value: PleaseSettingsConfigBuilder) -> Result<Self, Self::Error> {
|
||||
Ok(Self {
|
||||
api_url: value.api_url.ok_or(value_is_missing("api_url"))?,
|
||||
git_username: value.git_username.clone(),
|
||||
git_email: value.git_username.clone(),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user