diff --git a/infrastructure/src/bin/bat_official_sync.rs b/infrastructure/src/bin/bat_official_sync.rs index 825fe8e..ea5b538 100644 --- a/infrastructure/src/bin/bat_official_sync.rs +++ b/infrastructure/src/bin/bat_official_sync.rs @@ -2024,9 +2024,9 @@ fn print_daemon_version_state_summary(version_state: &OfficialVersionState) { } } -fn visible_historical_failed_versions<'a>( - version_state: &'a OfficialVersionState, -) -> Vec<&'a OfficialFailedVersionRecord> { +fn visible_historical_failed_versions( + version_state: &OfficialVersionState, +) -> Vec<&OfficialFailedVersionRecord> { let in_progress = version_state.in_progress_version.as_ref(); version_state .failed_versions diff --git a/infrastructure/src/official_update.rs b/infrastructure/src/official_update.rs index fdc50d8..2d3fadc 100644 --- a/infrastructure/src/official_update.rs +++ b/infrastructure/src/official_update.rs @@ -911,9 +911,11 @@ impl OfficialUpdateService { )); Some(resolve_bootstrap( &config.launcher_version, - &config.curl_command, - &config.curl_proxy, - &config.unzip_command, + &BootstrapTools { + curl_command: &config.curl_command, + curl_proxy: &config.curl_proxy, + unzip_command: &config.unzip_command, + }, &bootstrap_cache_path, !config.dry_run, &mut progress, @@ -2364,11 +2366,16 @@ fn game_main_config_snapshot(config: &YostarJpGameMainConfig) -> GameMainConfigS } } +/// 官方引导链路使用的外部命令与代理配置。 +struct BootstrapTools<'a> { + curl_command: &'a Path, + curl_proxy: &'a CurlProxyConfig, + unzip_command: &'a Path, +} + fn resolve_bootstrap( launcher_version: &str, - curl_command: &Path, - curl_proxy: &CurlProxyConfig, - unzip_command: &Path, + tools: &BootstrapTools<'_>, cache_path: &Path, write_cache: bool, progress: &mut dyn FnMut(OfficialUpdateProgress), @@ -2377,9 +2384,9 @@ fn resolve_bootstrap( check_shutdown_requested(should_cancel)?; let launcher = OfficialLauncherBootstrapService::with_curl_command( launcher_version, - curl_command.to_string_lossy().to_string(), + tools.curl_command.to_string_lossy().to_string(), ) - .with_proxy_config(curl_proxy.clone()); + .with_proxy_config(tools.curl_proxy.clone()); progress(OfficialUpdateProgress::new( "launcher", "正在拉取官方启动器游戏配置和远端 manifest", @@ -2425,10 +2432,10 @@ fn resolve_bootstrap( check_shutdown_requested(should_cancel)?; let bootstrapper = OfficialGameMainConfigBootstrapService::with_commands( launcher_version, - curl_command.to_path_buf(), - unzip_command.to_path_buf(), + tools.curl_command.to_path_buf(), + tools.unzip_command.to_path_buf(), ) - .with_proxy_config(curl_proxy.clone()); + .with_proxy_config(tools.curl_proxy.clone()); let bootstrap = bootstrapper.fetch_bootstrap().map_err(anyhow::Error::msg)?; check_shutdown_requested(should_cancel)?; let launcher_metadata = LauncherMetadataSnapshot {