fix: do not overwrite whole file

This commit is contained in:
Patrick 2024-11-15 13:23:33 +01:00
parent 622cb26a3e
commit b2ba972a1e
Signed by: patrick
GPG key ID: 451F95EFB8BECD0F

View file

@ -219,7 +219,11 @@ async fn main() -> Result<()> {
get_diff(pr, &opts.path, &client).await?;
let pr = get_pr(pr, &client).await?;
let title = pr.title.replace("\n", "//");
fs::write(&opts.pr_file, format!("{} # {}", pr.number, title))?;
let file = OpenOptions::new()
.write(true)
.append(true)
.open(&opts.pr_file)?;
writeln!(file, format!("{} # {}", pr.number, title))?;
}
};
Ok(())