fix: do not overwrite whole file
This commit is contained in:
parent
622cb26a3e
commit
1e3cba55bf
|
@ -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(())
|
||||
|
|
Loading…
Reference in a new issue