Skip to content

Commit

Permalink
refactor(changelog): do not output to stdout when prepend is used
Browse files Browse the repository at this point in the history
  • Loading branch information
orhun committed Mar 2, 2024
1 parent a25a114 commit 8ee0da1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions git-cliff/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ pub fn run(mut args: Opt) -> Result<()> {
changelog.write_context(&mut io::stdout())
};
}
if let Some(path) = args.prepend {
if let Some(ref path) = args.prepend {
changelog.prepend(fs::read_to_string(&path)?, &mut File::create(path)?)?;
}
if let Some(path) = args.output {
Expand All @@ -494,7 +494,9 @@ pub fn run(mut args: Opt) -> Result<()> {
} else {
changelog.generate(&mut output)
}
} else {
} else if args.prepend.is_none() {
changelog.generate(&mut io::stdout())
} else {
Ok(())
}
}

0 comments on commit 8ee0da1

Please sign in to comment.