From 6b689c8d6c033b8985517ba39af827eda15e546d Mon Sep 17 00:00:00 2001 From: Quaternions Date: Wed, 10 Apr 2024 03:45:22 -0700 Subject: [PATCH] hack for model uploads --- src/main.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 554ceb9..2c5274f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1486,11 +1486,12 @@ async fn compile(config:CompileConfig)->AResult<()>{ std::io::BufReader::new(std::fs::File::open(template_path)?) }; let mut dom=load_dom(input)?; + //hack to traverse root folder as the root object + dom.root_mut().name="src".to_owned(); //add in scripts and models let mut folder=config.input_folder.clone(); - folder.push("src"); - let mut stack:Vec=dom.root().children().into_iter().map(|&referent|CompileStackInstruction::TraverseReferent(referent,None)).collect(); + let mut stack:Vec=vec![CompileStackInstruction::TraverseReferent(dom.root_ref(),None)]; while let Some(instruction)=stack.pop(){ match instruction{ CompileStackInstruction::TraverseReferent(item_ref,blacklist)=>{