Change each VfsItem to keep a full route instead of just its name

This commit is contained in:
Lucien Greathouse
2018-01-03 15:56:19 -08:00
parent 13ce04abb2
commit 9720c56765
4 changed files with 44 additions and 31 deletions

View File

@@ -21,8 +21,8 @@ impl JsonModelPlugin {
impl Plugin for JsonModelPlugin {
fn transform_file(&self, _plugins: &PluginChain, vfs_item: &VfsItem) -> TransformFileResult {
match vfs_item {
&VfsItem::File { ref contents, ref name } => {
let rbx_name = match JSON_MODEL_PATTERN.captures(name) {
&VfsItem::File { ref contents, .. } => {
let rbx_name = match JSON_MODEL_PATTERN.captures(vfs_item.name()) {
Some(captures) => captures.get(1).unwrap().as_str().to_string(),
None => return TransformFileResult::Pass,
};
@@ -30,7 +30,7 @@ impl Plugin for JsonModelPlugin {
let mut rbx_item: RbxItem = match serde_json::from_str(contents) {
Ok(v) => v,
Err(_) => {
eprintln!("Unable to parse JSON Model File named {}", name);
eprintln!("Unable to parse JSON Model File named {}", vfs_item.name());
return TransformFileResult::Pass; // This should be an error in the future!
},