Refactor & Optimize: Launch target detection as soon as possible

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
Jiahao XU 2022-08-05 00:13:35 +10:00
parent 4dae214af3
commit b4c6db7cda
No known key found for this signature in database
GPG key ID: 591C0B03040416D6

View file

@ -291,6 +291,9 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> {
bin_dir: opts.bin_dir.take(),
};
// Launch target detection
let desired_targets = get_desired_targets(&opts.targets);
// Initialize reqwest client
let client = create_reqwest_client(opts.secure, opts.min_tls_version.map(|v| v.into()))?;
@ -318,9 +321,6 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> {
// Initialize UI thread
let mut uithread = UIThread::new(!opts.no_confirm);
// Launch target detection
let desired_targets = get_desired_targets(&opts.targets);
// Compute install directory
let (install_path, custom_install_path) = get_install_path(opts.install_path.as_deref());
let install_path = install_path.ok_or_else(|| {