mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-21 05:06:29 +00:00
Reintroduce instigating paths for snapshot middleware
This commit is contained in:
@@ -94,9 +94,9 @@ impl ChangeProcessor {
|
||||
};
|
||||
|
||||
let snapshot = match instigating_source {
|
||||
InstigatingSource::Path(instigating_path) => {
|
||||
InstigatingSource::Path(path) => {
|
||||
let entry = imfs
|
||||
.get(instigating_path)
|
||||
.get(path)
|
||||
.expect("could not get instigating path from filesystem");
|
||||
|
||||
let snapshot = snapshot_from_imfs(&mut imfs, &entry)
|
||||
|
||||
@@ -40,6 +40,7 @@ impl SnapshotMiddleware for SnapshotCsv {
|
||||
Ok(Some(InstanceSnapshot {
|
||||
snapshot_id: None,
|
||||
metadata: InstanceMetadata {
|
||||
instigating_source: Some(entry.path().to_path_buf().into()),
|
||||
relevant_paths: vec![entry.path().to_path_buf()],
|
||||
..Default::default()
|
||||
},
|
||||
|
||||
@@ -44,6 +44,7 @@ impl SnapshotMiddleware for SnapshotDir {
|
||||
Ok(Some(InstanceSnapshot {
|
||||
snapshot_id: None,
|
||||
metadata: InstanceMetadata {
|
||||
instigating_source: Some(entry.path().to_path_buf().into()),
|
||||
relevant_paths: vec![entry.path().to_path_buf()],
|
||||
..Default::default()
|
||||
},
|
||||
|
||||
@@ -52,6 +52,7 @@ impl SnapshotMiddleware for SnapshotJsonModel {
|
||||
|
||||
let mut snapshot = instance.core.into_snapshot(instance_name);
|
||||
|
||||
snapshot.metadata.instigating_source = Some(entry.path().to_path_buf().into());
|
||||
snapshot.metadata.relevant_paths = vec![entry.path().to_path_buf()];
|
||||
|
||||
Ok(Some(snapshot))
|
||||
|
||||
@@ -91,6 +91,7 @@ fn snapshot_lua_file<F: ImfsFetcher>(
|
||||
Ok(Some(InstanceSnapshot {
|
||||
snapshot_id: None,
|
||||
metadata: InstanceMetadata {
|
||||
instigating_source: Some(entry.path().to_path_buf().into()),
|
||||
relevant_paths: vec![entry.path().to_path_buf()],
|
||||
..Default::default()
|
||||
},
|
||||
|
||||
@@ -43,6 +43,7 @@ impl SnapshotMiddleware for SnapshotRbxlx {
|
||||
|
||||
let mut snapshot = InstanceSnapshot::from_tree(&temp_tree, root_id);
|
||||
snapshot.name = Cow::Owned(instance_name);
|
||||
snapshot.metadata.instigating_source = Some(entry.path().to_path_buf().into());
|
||||
snapshot.metadata.relevant_paths = vec![entry.path().to_path_buf()];
|
||||
|
||||
Ok(Some(snapshot))
|
||||
|
||||
@@ -49,6 +49,7 @@ impl SnapshotMiddleware for SnapshotRbxm {
|
||||
if children.len() == 1 {
|
||||
let mut snapshot = InstanceSnapshot::from_tree(&temp_tree, children[0]);
|
||||
snapshot.name = Cow::Owned(instance_name);
|
||||
snapshot.metadata.instigating_source = Some(entry.path().to_path_buf().into());
|
||||
snapshot.metadata.relevant_paths = vec![entry.path().to_path_buf()];
|
||||
|
||||
Ok(Some(snapshot))
|
||||
|
||||
@@ -45,6 +45,7 @@ impl SnapshotMiddleware for SnapshotRbxmx {
|
||||
if children.len() == 1 {
|
||||
let mut snapshot = InstanceSnapshot::from_tree(&temp_tree, children[0]);
|
||||
snapshot.name = Cow::Owned(instance_name);
|
||||
snapshot.metadata.instigating_source = Some(entry.path().to_path_buf().into());
|
||||
snapshot.metadata.relevant_paths = vec![entry.path().to_path_buf()];
|
||||
|
||||
Ok(Some(snapshot))
|
||||
|
||||
@@ -5,6 +5,8 @@ expression: instance_snapshot
|
||||
snapshot_id: ~
|
||||
metadata:
|
||||
ignore_unknown_instances: false
|
||||
instigating_source:
|
||||
Path: /foo.client.lua
|
||||
relevant_paths:
|
||||
- /foo.client.lua
|
||||
name: foo
|
||||
@@ -13,4 +15,4 @@ properties:
|
||||
Source:
|
||||
Type: String
|
||||
Value: Hello there!
|
||||
children: []
|
||||
children: []
|
||||
|
||||
@@ -5,6 +5,8 @@ expression: instance_snapshot
|
||||
snapshot_id: ~
|
||||
metadata:
|
||||
ignore_unknown_instances: false
|
||||
instigating_source:
|
||||
Path: /foo.csv
|
||||
relevant_paths:
|
||||
- /foo.csv
|
||||
name: foo
|
||||
@@ -13,4 +15,4 @@ properties:
|
||||
Contents:
|
||||
Type: String
|
||||
Value: "[{\"key\":\"Ack\",\"example\":\"An exclamation of despair\",\"source\":\"Ack!\",\"values\":{\"es\":\"¡Ay!\"}}]"
|
||||
children: []
|
||||
children: []
|
||||
|
||||
@@ -5,9 +5,11 @@ expression: instance_snapshot
|
||||
snapshot_id: ~
|
||||
metadata:
|
||||
ignore_unknown_instances: false
|
||||
instigating_source:
|
||||
Path: /foo
|
||||
relevant_paths:
|
||||
- /foo
|
||||
name: foo
|
||||
class_name: Folder
|
||||
properties: {}
|
||||
children: []
|
||||
children: []
|
||||
|
||||
@@ -5,6 +5,8 @@ expression: instance_snapshot
|
||||
snapshot_id: ~
|
||||
metadata:
|
||||
ignore_unknown_instances: false
|
||||
instigating_source:
|
||||
Path: /foo
|
||||
relevant_paths:
|
||||
- /foo
|
||||
name: foo
|
||||
@@ -14,9 +16,11 @@ children:
|
||||
- snapshot_id: ~
|
||||
metadata:
|
||||
ignore_unknown_instances: false
|
||||
instigating_source:
|
||||
Path: /foo/Child
|
||||
relevant_paths:
|
||||
- /foo/Child
|
||||
name: Child
|
||||
class_name: Folder
|
||||
properties: {}
|
||||
children: []
|
||||
children: []
|
||||
|
||||
@@ -5,6 +5,8 @@ expression: instance_snapshot
|
||||
snapshot_id: ~
|
||||
metadata:
|
||||
ignore_unknown_instances: false
|
||||
instigating_source:
|
||||
Path: /foo.txt
|
||||
relevant_paths:
|
||||
- /foo.txt
|
||||
name: foo
|
||||
@@ -13,4 +15,4 @@ properties:
|
||||
Value:
|
||||
Type: String
|
||||
Value: Hello there!
|
||||
children: []
|
||||
children: []
|
||||
|
||||
@@ -5,6 +5,8 @@ expression: instance_snapshot
|
||||
snapshot_id: ~
|
||||
metadata:
|
||||
ignore_unknown_instances: false
|
||||
instigating_source:
|
||||
Path: /foo.model.json
|
||||
relevant_paths:
|
||||
- /foo.model.json
|
||||
name: foo
|
||||
@@ -21,4 +23,4 @@ children:
|
||||
name: The Child
|
||||
class_name: StringValue
|
||||
properties: {}
|
||||
children: []
|
||||
children: []
|
||||
|
||||
@@ -5,6 +5,8 @@ expression: instance_snapshot
|
||||
snapshot_id: ~
|
||||
metadata:
|
||||
ignore_unknown_instances: false
|
||||
instigating_source:
|
||||
Path: /foo.lua
|
||||
relevant_paths:
|
||||
- /foo.lua
|
||||
name: foo
|
||||
@@ -13,4 +15,4 @@ properties:
|
||||
Source:
|
||||
Type: String
|
||||
Value: Hello there!
|
||||
children: []
|
||||
children: []
|
||||
|
||||
@@ -5,6 +5,8 @@ expression: instance_snapshot
|
||||
snapshot_id: ~
|
||||
metadata:
|
||||
ignore_unknown_instances: false
|
||||
instigating_source:
|
||||
Path: /foo.server.lua
|
||||
relevant_paths:
|
||||
- /foo.server.lua
|
||||
name: foo
|
||||
@@ -13,4 +15,4 @@ properties:
|
||||
Source:
|
||||
Type: String
|
||||
Value: Hello there!
|
||||
children: []
|
||||
children: []
|
||||
|
||||
@@ -52,6 +52,7 @@ impl SnapshotMiddleware for SnapshotTxt {
|
||||
Ok(Some(InstanceSnapshot {
|
||||
snapshot_id: None,
|
||||
metadata: InstanceMetadata {
|
||||
instigating_source: Some(entry.path().to_path_buf().into()),
|
||||
relevant_paths: vec![entry.path().to_path_buf()],
|
||||
..Default::default()
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user