match/lib/match/nuke.rb in fastlane-2.13.0 vs match/lib/match/nuke.rb in fastlane-2.14.0

- old
+ new

@@ -11,11 +11,11 @@ self.params = params self.type = type params[:workspace] = GitHelper.clone(params[:git_url], params[:shallow_clone], skip_docs: params[:skip_docs], branch: params[:git_branch]) - had_app_identifier = self.params[:app_identifier] + had_app_identifier = self.params.fetch(:app_identifier, ask: false) self.params[:app_identifier] = '' # we don't really need a value here FastlaneCore::PrintTable.print_values(config: params, hide_keys: [:app_identifier, :workspace], title: "Summary for match nuke #{Fastlane::VERSION}") @@ -49,16 +49,20 @@ # Collect all the certs/profiles def prepare_list UI.message "Fetching certificates and profiles..." cert_type = Match.cert_type_sym(type) - prov_types = [:development] + prov_types = [] + prov_types = [:development] if cert_type == :development prov_types = [:appstore, :adhoc] if cert_type == :distribution + prov_types = [:enterprise] if cert_type == :enterprise Spaceship.login(params[:username]) Spaceship.select_team + UI.user_error!("`fastlane match nuke` doesn't support enterprise accounts") if Spaceship.client.in_house? + self.certs = certificate_type(cert_type).all self.profiles = [] prov_types.each do |prov_type| self.profiles += profile_type(prov_type).all end @@ -168,23 +172,23 @@ end end # The kind of certificate we're interested in def certificate_type(type) - cert_type = Spaceship.certificate.production - cert_type = Spaceship.certificate.development if type == :development - cert_type = Spaceship.certificate.in_house if Match.enterprise? && Spaceship.client.in_house? - - cert_type + { + distribution: Spaceship.certificate.production, + development: Spaceship.certificate.development, + enterprise: Spaceship.certificate.in_house + }[type] ||= raise "Unknown type '#{type}'" end # The kind of provisioning profile we're interested in - def profile_type(type) - profile_type = Spaceship.provisioning_profile.app_store - profile_type = Spaceship.provisioning_profile.in_house if Match.enterprise? && Spaceship.client.in_house? - profile_type = Spaceship.provisioning_profile.ad_hoc if type == :adhoc - profile_type = Spaceship.provisioning_profile.development if type == :development - - profile_type + def profile_type(prov_type) + { + appstore: Spaceship.provisioning_profile.app_store, + development: Spaceship.provisioning_profile.development, + enterprise: Spaceship.provisioning_profile.in_house, + adhoc: Spaceship.provisioning_profile.ad_hoc + }[prov_type] ||= raise "Unknown provisioning type '#{prov_type}'" end end end