sigh/lib/sigh/runner.rb in fastlane-2.74.1 vs sigh/lib/sigh/runner.rb in fastlane-2.75.0.beta.20180109010003

- old
+ new

@@ -13,31 +13,31 @@ def run FastlaneCore::PrintTable.print_values(config: Sigh.config, hide_keys: [:output_path], title: "Summary for sigh #{Fastlane::VERSION}") - UI.message "Starting login with user '#{Sigh.config[:username]}'" + UI.message("Starting login with user '#{Sigh.config[:username]}'") Spaceship.login(Sigh.config[:username], nil) Spaceship.select_team - UI.message "Successfully logged in" + UI.message("Successfully logged in") profiles = [] if Sigh.config[:skip_fetch_profiles] profiles ||= fetch_profiles # download the profile if it's there if profiles.count > 0 - UI.success "Found #{profiles.count} matching profile(s)" + UI.success("Found #{profiles.count} matching profile(s)") profile = profiles.first if Sigh.config[:force] # Recreating the profile ensures it has all of the requested properties (cert, name, etc.) - UI.important "Recreating the profile" + UI.important("Recreating the profile") profile.delete! profile = create_profile! end else UI.user_error!("No matching provisioning profile found and can not create a new one because you enabled `readonly`") if Sigh.config[:readonly] - UI.important "No existing profiles found, that match the certificates you have installed locally! Creating a new provisioning profile for you" + UI.important("No existing profiles found, that match the certificates you have installed locally! Creating a new provisioning profile for you") ensure_app_exists! profile = create_profile! end UI.user_error!("Something went wrong fetching the latest profile") unless profile @@ -63,11 +63,11 @@ @profile_type end # Fetches a profile matching the user's search requirements def fetch_profiles - UI.message "Fetching profiles..." + UI.message("Fetching profiles...") results = profile_type.find_by_bundle_id(bundle_id: Sigh.config[:app_identifier], mac: Sigh.config[:platform].to_s == 'macos', sub_platform: Sigh.config[:platform].to_s == 'tvos' ? 'tvOS' : nil) results = results.find_all do |current_profile| if current_profile.valid? || Sigh.config[:force] @@ -87,11 +87,11 @@ results = filter_profiles_for_adhoc_or_app_store(results) return results if Sigh.config[:skip_certificate_verification] - UI.message "Verifying certificates..." + UI.message("Verifying certificates...") return results.find_all do |current_profile| installed = false # Attempts to download all certificates from this profile # for checking if they are installed. @@ -130,16 +130,16 @@ bundle_id = Sigh.config[:app_identifier] name = Sigh.config[:provisioning_name] || [bundle_id, profile_type.pretty_type].join(' ') unless Sigh.config[:skip_fetch_profiles] if Spaceship.provisioning_profile.all.find { |p| p.name == name } - UI.error "The name '#{name}' is already taken, using another one." + UI.error("The name '#{name}' is already taken, using another one.") name += " #{Time.now.to_i}" end end - UI.important "Creating new provisioning profile for '#{Sigh.config[:app_identifier]}' with name '#{name}' for '#{Sigh.config[:platform]}' platform" + UI.important("Creating new provisioning profile for '#{Sigh.config[:app_identifier]}' with name '#{name}' for '#{Sigh.config[:platform]}' platform") profile = profile_type.create!(name: name, bundle_id: bundle_id, certificate: cert, mac: Sigh.config[:platform].to_s == 'macos', sub_platform: Sigh.config[:platform].to_s == 'tvos' ? 'tvOS' : nil, @@ -221,23 +221,23 @@ FastlaneCore::CertChecker.installed?(file.path) end end if certificates.count > 1 and !Sigh.config[:development] - UI.important "Found more than one code signing identity. Choosing the first one. Check out `fastlane sigh --help` to see all available options." - UI.important "Available Code Signing Identities for current filters:" + UI.important("Found more than one code signing identity. Choosing the first one. Check out `fastlane sigh --help` to see all available options.") + UI.important("Available Code Signing Identities for current filters:") certificates.each do |c| str = ["\t- Name:", c.owner_name, "- ID:", c.id + " - Expires", c.expires.strftime("%d/%m/%Y")].join(" ") - UI.message str.green + UI.message(str.green) end end if certificates.count == 0 filters = "" filters << "Owner Name: '#{Sigh.config[:cert_owner_name]}' " if Sigh.config[:cert_owner_name] filters << "Certificate ID: '#{Sigh.config[:cert_id]}' " if Sigh.config[:cert_id] - UI.important "No certificates for filter: #{filters}" if filters.length > 0 + UI.important("No certificates for filter: #{filters}") if filters.length > 0 message = "Could not find a matching code signing identity for type '#{profile_type.to_s.split(':').last}'. " message += "It is recommended to use match to manage code signing for you, more information on https://codesigning.guide." message += "If you don't want to do so, you can also use cert to generate a new one: https://fastlane.tools/cert" UI.user_error!(message) end @@ -246,11 +246,11 @@ return certificates.first end # Downloads and stores the provisioning profile def download_profile(profile) - UI.important "Downloading provisioning profile..." + UI.important("Downloading provisioning profile...") profile_name ||= "#{profile_type.pretty_type}_#{Sigh.config[:app_identifier]}" if Sigh.config[:platform].to_s == 'tvos' profile_name += "_tvos" end @@ -261,11 +261,11 @@ output_path = File.join(tmp_path, profile_name) File.open(output_path, "wb") do |f| f.write(profile.download) end - UI.success "Successfully downloaded provisioning profile..." + UI.success("Successfully downloaded provisioning profile...") return output_path end # Makes sure the current App ID exists. If not, it will show an appropriate error message def ensure_app_exists! @@ -273,19 +273,19 @@ print_produce_command(Sigh.config) UI.user_error!("Could not find App with App Identifier '#{Sigh.config[:app_identifier]}'") end def print_produce_command(config) - UI.message "" - UI.message "==========================================".yellow - UI.message "Could not find App ID with bundle identifier '#{config[:app_identifier]}'" - UI.message "You can easily generate a new App ID on the Developer Portal using 'produce':" - UI.message "" - UI.message "fastlane produce -u #{config[:username]} -a #{config[:app_identifier]} --skip_itc".yellow - UI.message "" - UI.message "You will be asked for any missing information, like the full name of your app" - UI.message "If the app should also be created on iTunes Connect, remove the " + "--skip_itc".yellow + " from the command above" - UI.message "==========================================".yellow - UI.message "" + UI.message("") + UI.message("==========================================".yellow) + UI.message("Could not find App ID with bundle identifier '#{config[:app_identifier]}'") + UI.message("You can easily generate a new App ID on the Developer Portal using 'produce':") + UI.message("") + UI.message("fastlane produce -u #{config[:username]} -a #{config[:app_identifier]} --skip_itc".yellow) + UI.message("") + UI.message("You will be asked for any missing information, like the full name of your app") + UI.message("If the app should also be created on iTunes Connect, remove the " + "--skip_itc".yellow + " from the command above") + UI.message("==========================================".yellow) + UI.message("") end end end