Skip to content

Commit

Permalink
Make removing files respect ignore_paths
Browse files Browse the repository at this point in the history
  • Loading branch information
Dekkonot committed Aug 15, 2024
1 parent f1ca6cb commit 5da5b05
Show file tree
Hide file tree
Showing 8 changed files with 86 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
source: tests/rojo_test/syncback_util.rs
assertion_line: 48
expression: "visualize_fs_snapshot(&fs_snapshot, &output_path)"
---
added_files: []
added_dirs:
- src
removed_files: []
removed_dirs: []
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "ignore_paths",
"tree": {
"$className": "DataModel",
"Workspace": {
"$properties": {
"CSGAsyncDynamicCollision": {
"Enum": 0
},
"DecreaseMinimumPartDensityMode": {
"Enum": 0
},
"MoverConstraintRootBehavior": {
"Enum": 0
},
"RenderingCacheOptimizations": {
"Enum": 0
},
"SignalBehavior": "Deferred",
"StreamOutBehavior": "Opportunistic",
"StreamingEnabled": true,
"StreamingIntegrityMode": "PauseOutsideLoadedArea"
},
"$path": "src"
}
},
"syncbackRules": {
"ignorePaths": [
"*.rbxm",
"*.luau"
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-- This script is not in the input place file.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "ignore_paths",
"tree": {
"$className": "DataModel",
"Workspace": {
"$properties": {
"CSGAsyncDynamicCollision": {
"Enum": 0
},
"DecreaseMinimumPartDensityMode": {
"Enum": 0
},
"MoverConstraintRootBehavior": {
"Enum": 0
},
"RenderingCacheOptimizations": {
"Enum": 0
},
"SignalBehavior": "Deferred",
"StreamOutBehavior": "Opportunistic",
"StreamingEnabled": true,
"StreamingIntegrityMode": "PauseOutsideLoadedArea"
},
"$path": "src"
}
},
"syncbackRules": {
"ignorePaths": [
"*.rbxm",
"*.luau"
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-- This script is not in the input place file.
7 changes: 7 additions & 0 deletions src/syncback/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,13 @@ pub fn syncback_loop(
);
for inst in &syncback.removed_children {
let path = inst.metadata().instigating_source.as_ref().unwrap().path();
if !is_valid_path(&ignore_patterns, project_path, path) {
log::debug!(
"Skipping removing {} because its matches an ignore pattern",
path.display()
);
continue;
}
if path.is_dir() {
fs_snapshot.remove_dir(path)
} else {
Expand Down
1 change: 1 addition & 0 deletions tests/tests/syncback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ syncback_basic_test! {
string_value_project,
child_but_not,
ignore_trees,
ignore_paths_removing,
}

0 comments on commit 5da5b05

Please sign in to comment.