mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-20 17:41:37 +00:00
Add init.meta.json support, untested
This commit is contained in:
parent
b9ebed14a5
commit
1c6c1298d5
3 changed files with 86 additions and 6 deletions
|
|
@ -126,10 +126,17 @@ fn snapshot_init<F: VfsFetcher>(
|
|||
if let Some(init_entry) = vfs.get(init_path).with_not_found()? {
|
||||
if let Some(dir_snapshot) = SnapshotDir::from_vfs(context, vfs, folder_entry)? {
|
||||
if let Some(mut init_snapshot) = snapshot_lua_file(vfs, &init_entry)? {
|
||||
if dir_snapshot.class_name != "Folder" {
|
||||
panic!(
|
||||
"init.lua, init.server.lua, and init.client.lua can \
|
||||
only be used if the instance produced by the parent \
|
||||
directory would be a Folder."
|
||||
);
|
||||
}
|
||||
|
||||
init_snapshot.name = dir_snapshot.name;
|
||||
init_snapshot.children = dir_snapshot.children;
|
||||
// TODO: Metadata
|
||||
// TODO: Validate directory class name is "Folder"
|
||||
// TODO: Apply metadata from folder
|
||||
|
||||
return Ok(Some(init_snapshot));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue