match/lib/match/importer.rb in fastlane-2.158.0 vs match/lib/match/importer.rb in fastlane-2.159.0

- old
+ new

@@ -1,9 +1,10 @@ require_relative 'spaceship_ensure' require_relative 'encryption' require_relative 'storage' require_relative 'module' +require_relative 'generator' require 'fastlane_core/provisioning_profile' require 'fileutils' module Match class Importer @@ -54,12 +55,13 @@ certificate_type = Spaceship::ConnectAPI::Certificate::CertificateType::DEVELOPER_ID_APPLICATION else UI.user_error!("Cert type '#{cert_type}' is not supported") end + prov_type = Match.profile_type_sym(params[:type]) output_dir_certs = File.join(storage.prefixed_working_directory, "certs", cert_type.to_s) - output_dir_profiles = File.join(storage.prefixed_working_directory, "profiles", cert_type.to_s) + output_dir_profiles = File.join(storage.prefixed_working_directory, "profiles", prov_type.to_s) # Need to get the cert id by comparing base64 encoded cert content with certificate content from the API responses Spaceship::Portal.login(params[:username]) Spaceship::Portal.select_team(team_id: params[:team_id], team_name: params[:team_name]) certs = Spaceship::ConnectAPI::Certificate.all(filter: { certificateType: certificate_type }) @@ -84,10 +86,11 @@ IO.copy_stream(p12_path, dest_p12_path) unless profile_path.nil? FileUtils.mkdir_p(output_dir_profiles) bundle_id = FastlaneCore::ProvisioningProfile.bundle_id(profile_path) profile_extension = FastlaneCore::ProvisioningProfile.profile_extension(profile_path) - dest_profile_path = File.join(output_dir_profiles, "#{cert_type.to_s.capitalize}_#{bundle_id}#{profile_extension}") + profile_type_name = Match::Generator.profile_type_name(prov_type) + dest_profile_path = File.join(output_dir_profiles, "#{profile_type_name}_#{bundle_id}#{profile_extension}") files_to_commit.push(dest_profile_path) IO.copy_stream(profile_path, dest_profile_path) end # Encrypt and commit