Browse Source

Ignore folder change on live reload. Close #118

index-subcmd
Vincent Prouillet 6 years ago
parent
commit
a07835bbe3
2 changed files with 6 additions and 1 deletions
  1. +1
    -1
      src/cmd/serve.rs
  2. +5
    -0
      src/rebuild.rs

+ 1
- 1
src/cmd/serve.rs View File

@@ -160,7 +160,7 @@ pub fn serve(interface: &str, port: &str, config_file: &str) -> Result<()> {
Write(path) |
Remove(path) |
Rename(_, path) => {
if is_temp_file(&path) {
if is_temp_file(&path) || path.is_dir() {
continue;
}



+ 5
- 0
src/rebuild.rs View File

@@ -98,6 +98,11 @@ pub fn after_content_change(site: &mut Site, path: &Path) -> Result<()> {

// A page or section got deleted
if !path.exists() {
// A folder got deleted, ignore this event
if !site.sections.contains_key(path) && !site.pages.contains_key(path) {
return Ok(());
}

if is_section {
// A section was deleted, many things can be impacted:
// - the pages of the section are becoming orphans


Loading…
Cancel
Save