Add init scripts as relevant paths to all directories.

This doesn't feel ideal. Though it's true that all directories are influenced by
any init scripts they have, the directory middleware shouldn't need to know
about Lua.

I don't really want to go back into working on the middleware chain since it
mostly feels like busywork when there are other things to build on in Rojo.

also all of this feels really complicated
This commit is contained in:
Lucien Greathouse
2019-11-18 18:28:36 -08:00
parent 715022def5
commit 246fd5f6c4
10 changed files with 76 additions and 1 deletions

View File

@@ -47,11 +47,22 @@ impl SnapshotMiddleware for SnapshotDir {
let meta_path = entry.path().join("init.meta.json");
let relevant_paths = vec![
entry.path().to_path_buf(),
meta_path.clone(),
// TODO: We shouldn't need to know about Lua existing in this
// middleware. Should we figure out a way for that function to add
// relevant paths to this middleware?
entry.path().join("init.lua"),
entry.path().join("init.server.lua"),
entry.path().join("init.client.lua"),
];
let mut snapshot = InstanceSnapshot {
snapshot_id: None,
metadata: InstanceMetadata {
instigating_source: Some(entry.path().to_path_buf().into()),
relevant_paths: vec![entry.path().to_path_buf(), meta_path.clone()],
relevant_paths,
..Default::default()
},
name: Cow::Owned(instance_name),