From 00f47881691728f68fdeb97baca31b6fdea9b96e Mon Sep 17 00:00:00 2001 From: Quaternions Date: Thu, 11 Jan 2024 13:59:32 -0800 Subject: [PATCH] prepare to write files with TOKIO!!! --- src/main.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main.rs b/src/main.rs index aa3089c..1c9ef5a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -117,7 +117,7 @@ async fn main()->AResult<()>{ write_template:!cli.no_template.unwrap_or(false), write_models:!cli.no_models.unwrap_or(false), write_scripts:!cli.no_scripts.unwrap_or(false), - }), + }).await, Commands::DecompileHistoryIntoGit=>decompile_history_into_git(DecompileHistoryConfig{ git_committer_name:cli.git_committer_name.unwrap(), git_committer_email:cli.git_committer_email.unwrap(), @@ -564,7 +564,7 @@ struct WriteConfig{ write_scripts:bool, } -fn write_files(config:WriteConfig,mut context:DecompiledContext)->AResult<()>{ +async fn write_files(config:WriteConfig,mut context:DecompiledContext)->AResult<()>{ let mut name_tally=std::collections::HashMap::::new(); let mut folder=config.output_folder.clone(); let mut stack=vec![WriteStackInstruction::Node(context.tree_refs.get(&context.dom.root_ref()).unwrap(),0)]; @@ -653,7 +653,7 @@ struct DecompileConfig{ write_scripts:bool, } -fn decompile(config:DecompileConfig)->AResult<()>{ +async fn decompile(config:DecompileConfig)->AResult<()>{ //rules: //Class Script|LocalScript|ModuleScript->$Name.lua //Class Model->$Name.rbxmx @@ -670,7 +670,7 @@ fn decompile(config:DecompileConfig)->AResult<()>{ write_template:config.write_template, write_models:config.write_models, write_scripts:config.write_scripts, - },context)?; + },context).await?; Ok(()) } @@ -684,7 +684,7 @@ struct WriteCommitConfig{ write_scripts:bool, } -fn write_commit(config:WriteCommitConfig,b:AResult<(AssetVersion,DecompiledContext)>,repo:&git2::Repository)->AResult<()>{ +async fn write_commit(config:WriteCommitConfig,b:AResult<(AssetVersion,DecompiledContext)>,repo:&git2::Repository)->AResult<()>{ let (asset_version,context)=b?; //clean output dir @@ -709,7 +709,7 @@ fn write_commit(config:WriteCommitConfig,b:AResult<(AssetVersion,DecompiledConte write_template:config.write_template, write_models:config.write_models, write_scripts:config.write_scripts, - },context)?; + },context).await?; let date=asset_version.created; @@ -789,7 +789,7 @@ async fn decompile_history_into_git(config:DecompileHistoryConfig)->AResult<()>{ write_template:config.write_template, write_models:config.write_models, write_scripts:config.write_scripts, - },b,&repo){ + },b,&repo).await{ Ok(())=>(), Err(e)=>println!("download/unzip/decompile/write/commit error: {}",e), }