From 21d61f777eb38809763b99eabbe8aa6308d721c9 Mon Sep 17 00:00:00 2001 From: Boni Garcia Date: Mon, 25 Mar 2024 22:26:45 +0100 Subject: [PATCH 1/3] [rust] Select release with artifact when filtering Edge response --- rust/src/edge.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/rust/src/edge.rs b/rust/src/edge.rs index a30e9dd137adf..4be3119edb657 100644 --- a/rust/src/edge.rs +++ b/rust/src/edge.rs @@ -447,7 +447,15 @@ impl SeleniumManager for EdgeManager { return self.unavailable_discovery(); } - let release = releases.first().unwrap(); + let releases_with_artifacts: Vec<&Release> = releases + .into_iter() + .filter(|r| !r.artifacts.is_empty()) + .collect(); + if releases_with_artifacts.is_empty() { + return self.unavailable_discovery(); + } + + let release = releases_with_artifacts.first().unwrap(); let artifacts: Vec<&Artifact> = release .artifacts .iter() From 3a66eb4e49b880af4f9d85ccb3412fb0e8d27f5f Mon Sep 17 00:00:00 2001 From: Boni Garcia Date: Tue, 26 Mar 2024 01:46:12 +0100 Subject: [PATCH 2/3] [rust] Run pkg util command with log --- rust/src/files.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/rust/src/files.rs b/rust/src/files.rs index 0191e858051a5..1548e7cf8d550 100644 --- a/rust/src/files.rs +++ b/rust/src/files.rs @@ -18,9 +18,10 @@ use crate::config::OS; use crate::config::OS::WINDOWS; use crate::{ - format_one_arg, format_three_args, format_two_args, run_shell_command_by_os, Command, Logger, - CP_VOLUME_COMMAND, HDIUTIL_ATTACH_COMMAND, HDIUTIL_DETACH_COMMAND, MACOS, - MSIEXEC_INSTALL_COMMAND, MV_PAYLOAD_COMMAND, MV_PAYLOAD_OLD_VERSIONS_COMMAND, PKGUTIL_COMMAND, + format_one_arg, format_three_args, format_two_args, run_shell_command_by_os, + run_shell_command_with_log, Command, Logger, CP_VOLUME_COMMAND, HDIUTIL_ATTACH_COMMAND, + HDIUTIL_DETACH_COMMAND, MACOS, MSIEXEC_INSTALL_COMMAND, MV_PAYLOAD_COMMAND, + MV_PAYLOAD_OLD_VERSIONS_COMMAND, PKGUTIL_COMMAND, }; use anyhow::anyhow; use anyhow::Error; @@ -199,7 +200,7 @@ pub fn uncompress_pkg( &out_folder, )); log.trace(format!("Running command: {}", command.display())); - run_shell_command_by_os(os, command)?; + run_shell_command_with_log(&log, os, command)?; fs::create_dir_all(target)?; let target_folder = path_to_string(target); From db8cd24b30e8a1af6bb26a959dd55a739a5d0f48 Mon Sep 17 00:00:00 2001 From: Boni Garcia Date: Tue, 26 Mar 2024 02:24:28 +0100 Subject: [PATCH 3/3] Revert "[rust] Run pkg util command with log" This reverts commit 4f74bc2b63d30684d8dc8e34bf3c934bde1135f2. --- rust/src/files.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/rust/src/files.rs b/rust/src/files.rs index 1548e7cf8d550..0191e858051a5 100644 --- a/rust/src/files.rs +++ b/rust/src/files.rs @@ -18,10 +18,9 @@ use crate::config::OS; use crate::config::OS::WINDOWS; use crate::{ - format_one_arg, format_three_args, format_two_args, run_shell_command_by_os, - run_shell_command_with_log, Command, Logger, CP_VOLUME_COMMAND, HDIUTIL_ATTACH_COMMAND, - HDIUTIL_DETACH_COMMAND, MACOS, MSIEXEC_INSTALL_COMMAND, MV_PAYLOAD_COMMAND, - MV_PAYLOAD_OLD_VERSIONS_COMMAND, PKGUTIL_COMMAND, + format_one_arg, format_three_args, format_two_args, run_shell_command_by_os, Command, Logger, + CP_VOLUME_COMMAND, HDIUTIL_ATTACH_COMMAND, HDIUTIL_DETACH_COMMAND, MACOS, + MSIEXEC_INSTALL_COMMAND, MV_PAYLOAD_COMMAND, MV_PAYLOAD_OLD_VERSIONS_COMMAND, PKGUTIL_COMMAND, }; use anyhow::anyhow; use anyhow::Error; @@ -200,7 +199,7 @@ pub fn uncompress_pkg( &out_folder, )); log.trace(format!("Running command: {}", command.display())); - run_shell_command_with_log(&log, os, command)?; + run_shell_command_by_os(os, command)?; fs::create_dir_all(target)?; let target_folder = path_to_string(target);