1
1
mirror of https://github.com/orhun/git-cliff.git synced 2024-08-17 02:40:32 +03:00
This commit is contained in:
DaniPopes 2024-06-24 20:32:04 +02:00
parent f4afa8cdaf
commit 8e084ad59d
No known key found for this signature in database
GPG Key ID: 0F09640DDB7AC692

View File

@ -533,7 +533,6 @@ pub fn run(mut args: Opt) -> Result<()> {
} else {
Box::new(io::stdout())
};
let out = &mut *out;
if args.bump || args.bumped_version {
let next_version = if let Some(next_version) = changelog.bump_version()? {
next_version
@ -552,15 +551,16 @@ pub fn run(mut args: Opt) -> Result<()> {
}
if args.context {
changelog.write_context(out)?;
changelog.write_context(&mut out)?;
return Ok(());
}
if let Some(path) = &args.prepend {
changelog.prepend(fs::read_to_string(path)?, &mut File::create(path)?)?;
let mut out = io::BufWriter::new(File::create(path)?);
changelog.prepend(fs::read_to_string(path)?, &mut out)?;
}
if args.output.is_some() || args.prepend.is_none() {
changelog.generate(out)?;
changelog.generate(&mut out)?;
}
Ok(())