From c6a8246513cf7c2dcb4c65147b1c26e1b7a82022 Mon Sep 17 00:00:00 2001 From: 9382 Date: Tue, 1 Oct 2024 20:44:43 +0100 Subject: [PATCH] support output-folder option for git-related features Repository-based logic seems to automatically be made relative to the top-level path the repo was initialised with, so we can actually support an output folder with no issues here --- src/main.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main.rs b/src/main.rs index 853c3ae..133e8e0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -325,8 +325,8 @@ struct DownloadDecompileSubcommand{ struct DecompileHistoryIntoGitSubcommand{ #[arg(long)] input_folder:PathBuf, - //currently output folder must be the current folder due to git2 limitations - //output_folder:cli.output.unwrap(), + #[arg(long)] + output_folder:Option, #[arg(long)] style:Style, #[arg(long)] @@ -351,8 +351,8 @@ struct DownloadAndDecompileHistoryIntoGitSubcommand{ cookie_envvar:Option, #[arg(long,group="cookie",required=true)] cookie_file:Option, - //currently output folder must be the current folder due to git2 limitations - //output_folder:cli.output.unwrap(), + #[arg(long)] + output_folder:Option, #[arg(long)] style:Style, #[arg(long)] @@ -590,7 +590,7 @@ async fn main()->AResult<()>{ git_committer_name:subcommand.git_committer_name, git_committer_email:subcommand.git_committer_email, input_folder:subcommand.input_folder, - output_folder:std::env::current_dir()?, + output_folder:subcommand.output_folder.unwrap_or_else(||std::env::current_dir().unwrap()), style:subcommand.style.rox(), write_template:subcommand.write_template.unwrap_or(false), write_models:subcommand.write_models.unwrap_or(false), @@ -605,7 +605,7 @@ async fn main()->AResult<()>{ subcommand.cookie_file, ).await?, asset_id:subcommand.asset_id, - output_folder:std::env::current_dir()?, + output_folder:subcommand.output_folder.unwrap_or_else(||std::env::current_dir().unwrap()), style:subcommand.style.rox(), write_template:subcommand.write_template.unwrap_or(false), write_models:subcommand.write_models.unwrap_or(false),