Skip to content

Commit

Permalink
Ensure file exists when receiving events for zola serve
Browse files Browse the repository at this point in the history
Closes #2563
  • Loading branch information
Keats committed Aug 15, 2024
1 parent 96f266e commit 1cc3ad3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 3 additions & 1 deletion components/site/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1046,7 +1046,9 @@ impl Site {
None => return Ok(()),
};

for (feed, feed_filename) in feeds.into_iter().zip(self.config.languages[lang].feed_filenames.iter()) {
for (feed, feed_filename) in
feeds.into_iter().zip(self.config.languages[lang].feed_filenames.iter())
{
if let Some(base) = base_path {
let mut components = Vec::new();
for component in base.components() {
Expand Down
6 changes: 6 additions & 0 deletions src/fs_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ pub fn filter_events(
}
let path = event.event.paths[0].clone();

// Since we debounce things, some files might already not exist anymore by the
// time we get to them
if !path.exists() {
continue;
}

if is_ignored_file(ignored_content_globset, &path) {
continue;
}
Expand Down

0 comments on commit 1cc3ad3

Please sign in to comment.