forked from rojo-rbx/rojo
feat: support name property in meta and model jsons
This commit is contained in:
@@ -158,8 +158,14 @@ pub fn syncback_lua<'sync>(
|
||||
|
||||
if !meta.is_empty() {
|
||||
let parent_location = snapshot.path.parent_err()?;
|
||||
let instance_name = &snapshot.new_inst().name;
|
||||
let meta_name = if crate::syncback::validate_file_name(instance_name).is_err() {
|
||||
crate::syncback::slugify_name(instance_name)
|
||||
} else {
|
||||
instance_name.clone()
|
||||
};
|
||||
fs_snapshot.add_file(
|
||||
parent_location.join(format!("{}.meta.json", new_inst.name)),
|
||||
parent_location.join(format!("{}.meta.json", meta_name)),
|
||||
serde_json::to_vec_pretty(&meta).context("cannot serialize metadata")?,
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user