diff --git a/rojo-test/syncback-test-snapshots/end_to_end__rojo_test__syncback_util__nested_projects_weird-stdout.snap b/rojo-test/syncback-test-snapshots/end_to_end__rojo_test__syncback_util__nested_projects_weird-stdout.snap index 370ed871..b727e039 100644 --- a/rojo-test/syncback-test-snapshots/end_to_end__rojo_test__syncback_util__nested_projects_weird-stdout.snap +++ b/rojo-test/syncback-test-snapshots/end_to_end__rojo_test__syncback_util__nested_projects_weird-stdout.snap @@ -4,5 +4,3 @@ expression: normalized_stdout --- Writing src/modules/ClientModule.luau Writing src/modules/ServerModule.luau -Removing client-only.project.json5 -Removing server-only.project.json5 diff --git a/src/syncback/mod.rs b/src/syncback/mod.rs index e391c23b..be41b797 100644 --- a/src/syncback/mod.rs +++ b/src/syncback/mod.rs @@ -418,6 +418,14 @@ pub fn syncback_loop_with_stats( log::debug!("Skipping project file: {}", old_path.display()); continue; } + // Never remove any nested project files - they define project structure + // and may be referenced via $path from other project files + if let Some(file_name) = old_path_norm.file_name().and_then(|n| n.to_str()) { + if file_name.ends_with(".project.json5") || file_name.ends_with(".project.json") { + log::debug!("Skipping nested project file: {}", old_path.display()); + continue; + } + } // Skip if this exact path is being written to if added_paths.contains(&old_path_norm) { continue;