diff --git a/src/main.rs b/src/main.rs index f1ef24e..65e555a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,7 +1,7 @@ use std::{ env, fmt::Write, - fs::{self, File}, + fs::{self, File, OpenOptions}, io::{self, BufRead, BufReader}, }; @@ -219,7 +219,9 @@ 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 mut file = OpenOptions::new().append(true).open(&opts.pr_file)?; + use std::io::Write; + writeln!(file, "{} # {}", pr.number, title)?; } }; Ok(())