diff --git a/src/main.rs b/src/main.rs index ce63233..aa3089c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -29,6 +29,11 @@ struct Cli{ #[arg(long)] no_template:Option, + #[arg(long)] + git_committer_name:Option, + #[arg(long)] + git_committer_email:Option, + #[arg(long)] asset_id:Option, @@ -114,6 +119,8 @@ async fn main()->AResult<()>{ write_scripts:!cli.no_scripts.unwrap_or(false), }), Commands::DecompileHistoryIntoGit=>decompile_history_into_git(DecompileHistoryConfig{ + git_committer_name:cli.git_committer_name.unwrap(), + git_committer_email:cli.git_committer_email.unwrap(), cookie:cookie.unwrap(), asset_id:cli.asset_id.unwrap(), output_folder:cli.output.unwrap(), @@ -669,6 +676,8 @@ fn decompile(config:DecompileConfig)->AResult<()>{ } struct WriteCommitConfig{ + git_committer_name:String, + git_committer_email:String, output_folder:std::path::PathBuf, write_template:bool, write_models:bool, @@ -704,7 +713,7 @@ fn write_commit(config:WriteCommitConfig,b:AResult<(AssetVersion,DecompiledConte let date=asset_version.created; - let sig=git2::Signature::new("roblox-git-history","git_history@strafes.net",&git2::Time::new(date.timestamp(),0)).unwrap(); + let sig=git2::Signature::new(config.git_committer_name.as_str(),config.git_committer_email.as_str(),&git2::Time::new(date.timestamp(),0)).unwrap(); let tree_id={ let mut tree_index = repo.index()?; tree_index.add_all([config.output_folder].iter(),git2::IndexAddOption::DEFAULT,None)?; @@ -738,6 +747,8 @@ fn write_commit(config:WriteCommitConfig,b:AResult<(AssetVersion,DecompiledConte struct DecompileHistoryConfig{ cookie:String, asset_id:AssetID, + git_committer_name:String, + git_committer_email:String, output_folder:std::path::PathBuf, write_template:bool, write_models:bool, @@ -772,6 +783,8 @@ async fn decompile_history_into_git(config:DecompileHistoryConfig)->AResult<()>{ .buffered(CONCURRENT_REQUESTS) .for_each(|b:AResult<_>|async{ match write_commit(WriteCommitConfig{ + git_committer_name:config.git_committer_name.clone(), + git_committer_email:config.git_committer_email.clone(), output_folder:config.output_folder.clone(), write_template:config.write_template, write_models:config.write_models,