Skip to content

Commit

Permalink
Remove old file when rbxm fallback triggers
Browse files Browse the repository at this point in the history
  • Loading branch information
Dekkonot committed Sep 26, 2024
1 parent ff21a40 commit 6249d47
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
source: tests/rojo_test/syncback_util.rs
assertion_line: 45
expression: "visualize_fs_snapshot(&fs_snapshot, &output_path)"
---
added_files:
Expand All @@ -9,4 +10,5 @@ added_dirs:
- ReplicatedStorage/ChildWithoutDuplicates
- ReplicatedStorage/ChildWithoutDuplicates/Child
removed_files: []
removed_dirs: []
removed_dirs:
- ReplicatedStorage/ChildWithDuplicates
Empty file.
5 changes: 5 additions & 0 deletions src/syncback/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,11 @@ pub fn syncback_loop(
let syncback = match middleware.syncback(&snapshot) {
Ok(syncback) => syncback,
Err(err) if middleware == Middleware::Dir => {
if snapshot.old_inst().is_some() {
// We need to remove the old FS representation if we're
// reserializing it as an rbxm.
fs_snapshot.remove_dir(&snapshot.path);
}
let new_middleware = match env::var(DEBUG_MODEL_FORMAT_VAR) {
Ok(value) if value == "1" => Middleware::Rbxmx,
Ok(value) if value == "2" => Middleware::JsonModel,
Expand Down

0 comments on commit 6249d47

Please sign in to comment.