mirror of
https://github.com/orhun/git-cliff.git
synced 2024-11-25 10:42:43 +03:00
fix(log): remove redundant logging while using --context
(#71)
This commit is contained in:
parent
f48d2077c3
commit
efd40e02b3
@ -1,9 +1,6 @@
|
||||
use git_cliff_core::commit::Commit;
|
||||
use git_cliff_core::config::Config;
|
||||
use git_cliff_core::error::{
|
||||
Error,
|
||||
Result,
|
||||
};
|
||||
use git_cliff_core::error::Result;
|
||||
use git_cliff_core::release::{
|
||||
Release,
|
||||
Releases,
|
||||
@ -28,11 +25,6 @@ impl<'a> Changelog<'a> {
|
||||
.as_deref()
|
||||
.unwrap_or_default()
|
||||
.to_string();
|
||||
if template.is_empty() {
|
||||
return Err(Error::ChangelogError(String::from(
|
||||
"changelog body cannot be empty",
|
||||
)));
|
||||
}
|
||||
if config.changelog.trim.unwrap_or(true) {
|
||||
template = template
|
||||
.lines()
|
||||
|
@ -83,13 +83,15 @@ pub fn run(mut args: Opt) -> Result<()> {
|
||||
let mut config = if path.exists() {
|
||||
Config::parse(&path)?
|
||||
} else {
|
||||
warn!(
|
||||
"{:?} is not found, using the default configuration.",
|
||||
args.config
|
||||
);
|
||||
if !args.context {
|
||||
warn!(
|
||||
"{:?} is not found, using the default configuration.",
|
||||
args.config
|
||||
);
|
||||
}
|
||||
EmbeddedConfig::parse()?
|
||||
};
|
||||
if config.changelog.body.is_none() {
|
||||
if config.changelog.body.is_none() && !args.context {
|
||||
warn!("Changelog body is not specified, using the default template.");
|
||||
config.changelog.body = EmbeddedConfig::parse()?.changelog.body;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user