Do not error if posts directory does not exist.
All checks were successful
build-natter Build build-natter has succeeded
format Build format has succeeded
rust-clippy Build rust-clippy has succeeded
rust-test Build rust-test has succeeded

This commit is contained in:
Tom Alexander 2023-12-23 17:14:31 -05:00
parent 5228851c0e
commit eb67327574
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE

View File

@ -61,6 +61,9 @@ async fn get_output_directory(config: &Config) -> Result<PathBuf, CustomError> {
async fn get_post_directories(config: &Config) -> Result<Vec<PathBuf>, CustomError> {
let mut ret = Vec::new();
if !config.get_posts_directory().exists() {
return Ok(ret);
}
let mut entries = tokio::fs::read_dir(config.get_posts_directory()).await?;
while let Some(entry) = entries.next_entry().await? {
let file_type = entry.file_type().await?;