fix updated counter

This commit is contained in:
postscriptum 2025-07-02 14:07:53 +03:00
parent 9f18f63df9
commit 1df12cee92
2 changed files with 5 additions and 6 deletions

View file

@ -56,7 +56,7 @@ impl Nex {
attachments: Option<Vec<(String, String, Source)>>,
tags: Option<Vec<String>>,
(published, updated): (DateTime<Utc>, Option<DateTime<Utc>>),
) -> Result<()> {
) -> Result<usize> {
// prepare destination
let mut p = PathBuf::from(self.users.get(name).unwrap());
p.push(published.format("%Y").to_string());
@ -82,7 +82,7 @@ impl Nex {
fs::write(s, updated.unwrap_or(published).to_string())?
} else {
println!("\t\t\tpost is up to date.");
return Ok(());
return Ok(0);
}
// format content pattern
@ -169,6 +169,6 @@ impl Nex {
}
fs::write(&p, c)?;
Ok(())
Ok(1)
}
}