diff --git a/match/lib/match/portal_cache.rb b/match/lib/match/portal_cache.rb index dc90e8e2652..a35e85d451d 100644 --- a/match/lib/match/portal_cache.rb +++ b/match/lib/match/portal_cache.rb @@ -18,8 +18,8 @@ def self.build(params:, bundle_id_identifiers:) profile_type: profile_type, additional_cert_types: params[:additional_cert_types], bundle_id_identifiers: bundle_id_identifiers, - needs_profiles_devices: ProfileIncludes.can_force_include?(params: params, notify: true) && !params[:force] && !params[:readonly], - needs_profiles_certificate_content: !ProfileIncludes.can_force_include_all_certificates?(params: params), + needs_profiles_devices: ProfileIncludes.can_force_include_all_devices?(params: params, notify: true), + needs_profiles_certificate_content: !ProfileIncludes.can_force_include_all_certificates?(params: params, notify: true), include_mac_in_profiles: params[:include_mac_in_profiles] ) diff --git a/match/lib/match/profile_includes.rb b/match/lib/match/profile_includes.rb index 38cce80bc7c..173dab0cf9a 100644 --- a/match/lib/match/profile_includes.rb +++ b/match/lib/match/profile_includes.rb @@ -46,7 +46,7 @@ def self.can_force_include_all_devices?(params:, notify: false) def self.devices_differ?(portal_profile:, platform:, include_mac_in_profiles:, cached_devices:) return false unless portal_profile - profile_devices = portal_profile.devices + profile_devices = portal_profile.devices || [] portal_devices = cached_devices portal_devices ||= Match::Portal::Fetcher.devices(platform: platform, include_mac_in_profiles: include_mac_in_profiles) @@ -102,7 +102,7 @@ def self.can_force_include_all_certificates?(params:, notify: false) def self.certificates_differ?(portal_profile:, platform:, cached_certificates:) return false unless portal_profile - profile_certs = portal_profile.certificates + profile_certs = portal_profile.certificates || [] portal_certs = cached_certificates portal_certs ||= Match::Portal::Fetcher.certificates(platform: platform, profile_type: portal_profile.profile_type) diff --git a/sigh/lib/sigh/options.rb b/sigh/lib/sigh/options.rb index 8728fceb12d..3bccf434848 100644 --- a/sigh/lib/sigh/options.rb +++ b/sigh/lib/sigh/options.rb @@ -205,10 +205,10 @@ def self.available_options is_string: false, default_value: nil, verify_block: proc do |value| + next if value.nil? if !value.kind_of?(Array) || - value.empty? || !value.all?(Spaceship::ConnectAPI::Certificate) - UI.user_error!("cached_certificates parameter must be a non-empty array of Spaceship::ConnectAPI::Certificate") unless value.kind_of?(Array) + UI.user_error!("cached_certificates parameter must be an array of Spaceship::ConnectAPI::Certificate") unless value.kind_of?(Array) end end), FastlaneCore::ConfigItem.new(key: :cached_devices, @@ -217,10 +217,10 @@ def self.available_options is_string: false, default_value: nil, verify_block: proc do |value| + next if value.nil? if !value.kind_of?(Array) || - value.empty? || !value.all?(Spaceship::ConnectAPI::Device) - UI.user_error!("cached_devices parameter must be a non-empty array of Spaceship::ConnectAPI::Device") + UI.user_error!("cached_devices parameter must be an array of Spaceship::ConnectAPI::Device") end end), FastlaneCore::ConfigItem.new(key: :cached_bundle_ids, @@ -229,10 +229,10 @@ def self.available_options is_string: false, default_value: nil, verify_block: proc do |value| + next if value.nil? if !value.kind_of?(Array) || - value.empty? || !value.all?(Spaceship::ConnectAPI::BundleId) - UI.user_error!("cached_bundle_ids parameter must be a non-empty array of Spaceship::ConnectAPI::BundleId") + UI.user_error!("cached_bundle_ids parameter must be an array of Spaceship::ConnectAPI::BundleId") end end), FastlaneCore::ConfigItem.new(key: :cached_profiles, @@ -241,10 +241,10 @@ def self.available_options is_string: false, default_value: nil, verify_block: proc do |value| + next if value.nil? if !value.kind_of?(Array) || - value.empty? || !value.all?(Spaceship::ConnectAPI::Profile) - UI.user_error!("cached_profiles parameter must be a non-empty array of Spaceship::ConnectAPI::Profile") + UI.user_error!("cached_profiles parameter must be an array of Spaceship::ConnectAPI::Profile") end end) ]