From 7b1bd29d4bd7eea6900454acaef8c40373d04042 Mon Sep 17 00:00:00 2001 From: Rusko124 Date: Mon, 7 Sep 2026 15:29:58 +0400 Subject: [PATCH 1/2] Stop a blank line in .ignore from excluding the whole Edge App An empty line became the pattern ^$, and walkdir yields the root directory itself with an empty relative path, so filter_entry pruned the entire tree before it was walked. A deploy then collected zero files and the server rejected it with "index.html is required". Any editor that leaves a trailing newline produced this. Blank lines are now skipped, and the walk root is exempt from the ignore rules so no future pattern can prune everything the same way. --- src/commands/edge_app/utils.rs | 6 +++++- src/commands/ignorer.rs | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/commands/edge_app/utils.rs b/src/commands/edge_app/utils.rs index 77265f4b..708b966f 100644 --- a/src/commands/edge_app/utils.rs +++ b/src/commands/edge_app/utils.rs @@ -64,6 +64,10 @@ impl FileChanges { } fn is_included(entry: &DirEntry, ignore: &Ignorer) -> bool { + if entry.depth() == 0 { + return true; + } + let exclusion_list = ["screenly.js", "screenly.yml", ".ignore", "instance.yml"]; if exclusion_list.contains(&entry.file_name().to_str().unwrap_or_default()) { return false; @@ -738,7 +742,7 @@ mod tests { .unwrap(); File::create(dir_path.join(".ignore")) .unwrap() - .write_all(b"file2.txt") + .write_all(b"file2.txt\n\n") .unwrap(); File::create(dir_path.join("instance.yml")) .unwrap() diff --git a/src/commands/ignorer.rs b/src/commands/ignorer.rs index 4e3210c7..f2b84298 100644 --- a/src/commands/ignorer.rs +++ b/src/commands/ignorer.rs @@ -19,6 +19,9 @@ impl Ignorer { for line in content.lines() { let pattern = line.trim(); + if pattern.is_empty() { + continue; + } if pattern.ends_with('/') { patterns.push(format!("^{}.*$", regex::escape(pattern))); } else if pattern.contains('*') { @@ -78,6 +81,21 @@ mod tests { assert!(!ignorer.is_ignored(Path::new("other_file.txt"))); } + #[test] + fn test_ignore_when_file_has_a_blank_line_should_not_ignore_the_root() { + let dir = tempdir().unwrap(); + + File::create(dir.path().join(".ignore")) + .unwrap() + .write_all(b"node_modules/\n\n") + .unwrap(); + + let ignorer = Ignorer::new(dir.path()).unwrap(); + + assert!(!ignorer.is_ignored(dir.path())); + assert!(ignorer.is_ignored(&dir.path().join("node_modules/react"))); + } + #[test] fn test_ignore_when_pattern_specified_should_ignore_files_matching_that_pattern() { let dir = tempdir().unwrap(); From 7497b825cb610d8ff29b46df6af238e20edb2a84 Mon Sep 17 00:00:00 2001 From: Rusko124 Date: Mon, 7 Sep 2026 15:34:16 +0400 Subject: [PATCH 2/2] Drop articles from the blank-line test name --- src/commands/ignorer.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/ignorer.rs b/src/commands/ignorer.rs index f2b84298..4c43350d 100644 --- a/src/commands/ignorer.rs +++ b/src/commands/ignorer.rs @@ -82,7 +82,7 @@ mod tests { } #[test] - fn test_ignore_when_file_has_a_blank_line_should_not_ignore_the_root() { + fn test_ignore_when_file_has_blank_line_should_not_ignore_root() { let dir = tempdir().unwrap(); File::create(dir.path().join(".ignore"))