Implement incremental syncback mode to preserve existing file structure

- Added an `incremental` flag to the `SyncbackCommand` to allow for preserving existing file structure and middleware formats during syncback operations.
- Enhanced the `syncback_loop` function to differentiate between clean mode and incremental mode, ensuring orphaned files are removed only in clean mode.
- Updated logging to reflect the mode of operation during syncback.
- Introduced new tests to validate the behavior of clean mode versus incremental mode, ensuring proper handling of orphaned files and preservation of existing structures.
This commit is contained in:
Joe 2026-02-01 08:14:20 -06:00
parent 0e5e809894
commit 58399bb863
39 changed files with 652 additions and 119 deletions

View file

@ -0,0 +1,10 @@
{
"name": "clean_mode_orphan_removal",
"tree": {
"$className": "DataModel",
"ReplicatedStorage": {
"$className": "ReplicatedStorage",
"$path": "src"
}
}
}

View file

@ -0,0 +1,3 @@
-- This script should be KEPT because the input model
-- has a ModuleScript with the same name "KeptScript"
print("I should be kept")

View file

@ -0,0 +1,3 @@
-- This nested script should also be REMOVED
-- when its parent folder is removed
print("I am also orphaned")

View file

@ -0,0 +1,3 @@
-- This script should be REMOVED in clean mode
-- because the input model doesn't have this script
print("I am orphaned")