Do not error if posts directory does not exist.
build-natter Build build-natter has succeeded Details
format Build format has succeeded Details
rust-clippy Build rust-clippy has succeeded Details
rust-test Build rust-test has succeeded Details

main
Tom Alexander 4 months ago
parent 5228851c0e
commit eb67327574
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE

@ -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?;

Loading…
Cancel
Save