From dde85fbf8a05d0223d1535a3725b5dc8184977a8 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Sat, 4 May 2024 19:37:33 -0700 Subject: [PATCH] use an empty dom instead of an empty template --- src/main.rs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/main.rs b/src/main.rs index 4620377..e00a3c1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1476,16 +1476,11 @@ enum TooComplicated{ async fn compile(config:CompileConfig)->AResult<()>{ //basically decompile in reverse order //load template dom - let input={ - let template_path=config.template.unwrap_or_else(||{ - let mut template_path=config.input_folder.clone(); - template_path.push("template.rbxlx"); - template_path - }); + let mut dom=match config.template{ //mr dom doesn't like tokio files - std::io::BufReader::new(std::fs::File::open(template_path)?) + Some(template_path)=>load_dom(std::io::BufReader::new(std::fs::File::open(template_path)?))?, + None=>rbx_dom_weak::WeakDom::default(), }; - let mut dom=load_dom(input)?; //hack to traverse root folder as the root object dom.root_mut().name="src".to_owned();