sigh/lib/sigh/runner.rb
# Fetches a profile matching the user's search requirements
Fetches a profile matching the user's search requirements
Fetches a profile matching the user ' s search requirements
def fetch_profiles
      UI.message "Fetching profiles..."
      results = profile_type.find_by_bundle_id(Sigh.config[:app_identifier], mac: Sigh.config[:platform].to_s == 'macos')
      results = results.find_all do |current_profile|
        if current_profile.valid? || Sigh.config[:force]
          true
        else
          UI.message("Provisioning Profile '#{current_profile.name}' is not valid, skipping this one...")
          false
        end
      end
      if Sigh.config[:provisioning_name].to_s.length > 0
        filtered = results.select { |p| p.name.strip == Sigh.config[:provisioning_name].strip }
        if Sigh.config[:ignore_profiles_with_different_name]
          results = filtered
        elsif (filtered || []).count > 0
          results = filtered
        end
      end
      results = results.find_all do |current_profile|
        if profile_type == Spaceship.provisioning_profile.ad_hoc
          current_profile.is_adhoc?
        elsif profile_type == Spaceship.provisioning_profile.app_store
          !current_profile.is_adhoc?
        else
          true
        end
      end
      return results if Sigh.config[:skip_certificate_verification]
      return results.find_all do |a|
        installed = false
        a.certificates.each do |cert|
          file = Tempfile.new('cert')
          file.write(cert.download_raw)
          file.close
          if FastlaneCore::CertChecker.installed?(file.path)
            installed = true
          else
            UI.message("Certificate for Provisioning Profile '#{a.name}' not available locally: #{cert.id}, skipping this one...")
          end
        end
        installed && a.certificate_valid?
      end
    end
def fetch_profiles UI . message "Fetching profiles..." results = profile_type . find_by_bundle_id ( Sigh . config [ :app_identifier ] , mac : Sigh . config [ :platform ] . to_s == 'macos' ) results = results . find_all do | current_profile | if current_profile . valid? || Sigh . config [ :force ] true else UI . message ( "Provisioning Profile '#{current_profile.name}' is not valid, skipping this one..." ) false end end if Sigh . config [ :provisioning_name ] . to_s . length > 0 filtered = results . select { | p | p . name . strip == Sigh . config [ :provisioning_name ] . strip } if Sigh . config [ :ignore_profiles_with_different_name ] results = filtered elsif ( filtered || [ ] ) . count > 0 results = filtered end end results = results . find_all do | current_profile | if profile_type == Spaceship . provisioning_profile . ad_hoc current_profile . is_adhoc? elsif profile_type == Spaceship . provisioning_profile . app_store ! current_profile . is_adhoc? else true end end return results if Sigh . config [ :skip_certificate_verification ] return results . find_all do | a | installed = false a . certificates . each do | cert | file = Tempfile . new ( 'cert' ) file . write ( cert . download_raw ) file . close if FastlaneCore :: CertChecker . installed? ( file . path ) installed = true else UI . message ( "Certificate for Provisioning Profile '#{a.name}' not available locally: #{cert.id}, skipping this one..." ) end end installed && a . certificate_valid? end end
Fetches a profile matching the user's search requirements
Fetches a profile matching the user ' s search requirements
# Take the provisioning profile name into account # Since September 20, 2016 spaceship doesn't distinguish between AdHoc and AppStore profiles # any more, since it requires an additional request # Instead we only call is_adhoc? on the matching profiles to speed up spaceship # Also make sure we have the certificate installed on the local machine