Do not error if posts directory does not exist.
This commit is contained in:
parent
5228851c0e
commit
eb67327574
@ -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…
Reference in New Issue
Block a user