Sha256: 3867e12afa81d2215b7564ebfcd75ef377221d3953054382917e93561044903d

Contents?: true

Size: 1.1 KB

Versions: 27

Compression:

Stored size: 1.1 KB

Contents

module Sigh
  class DownloadAll
    # Download all valid provisioning profiles
    def download_all
      UI.message "Starting login with user '#{Sigh.config[:username]}'"
      Spaceship.login(Sigh.config[:username], nil)
      Spaceship.select_team
      UI.message "Successfully logged in"

      Spaceship.provisioning_profile.all.each do |profile|
        if profile.valid?
          UI.message "Downloading profile '#{profile.name}'..."
          download_profile(profile)
        else
          UI.important "Skipping invalid/expired profile '#{profile.name}'"
        end
      end
    end

    def download_profile(profile)
      FileUtils.mkdir_p(Sigh.config[:output_path])

      type_name = profile.class.pretty_type
      type_name = "AdHoc" if profile.is_adhoc?

      profile_name = "#{type_name}_#{profile.app.bundle_id}.mobileprovision" # default name

      output_path = File.join(Sigh.config[:output_path], profile_name)
      File.open(output_path, "wb") do |f|
        f.write(profile.download)
      end

      Manager.install_profile(output_path) unless Sigh.config[:skip_install]
    end
  end
end

Version data entries

27 entries across 27 versions & 2 rubygems

Version Path
fastlane-2.13.0 sigh/lib/sigh/download_all.rb
fastlane-2.12.0 sigh/lib/sigh/download_all.rb
fastlane-2.11.0 sigh/lib/sigh/download_all.rb
fastlane-2.10.0 sigh/lib/sigh/download_all.rb
fastlane-2.9.0 sigh/lib/sigh/download_all.rb
fastlane-2.8.0 sigh/lib/sigh/download_all.rb
fastlane-2.7.0 sigh/lib/sigh/download_all.rb
fastlane-2.6.0 sigh/lib/sigh/download_all.rb
fastlane-2.5.0 sigh/lib/sigh/download_all.rb
fastlane-2.4.0 sigh/lib/sigh/download_all.rb
fastlane-2.3.1 sigh/lib/sigh/download_all.rb
fastlane-2.3.0 sigh/lib/sigh/download_all.rb
fastlane-2.2.0 sigh/lib/sigh/download_all.rb
fastlane-2.1.3 sigh/lib/sigh/download_all.rb
fastlane-2.1.2 sigh/lib/sigh/download_all.rb
fastlane-2.1.1 sigh/lib/sigh/download_all.rb
sigh-2.0.1 lib/sigh/download_all.rb
fastlane-2.1.0 sigh/lib/sigh/download_all.rb
fastlane-2.0.5 sigh/lib/sigh/download_all.rb
fastlane-2.0.4 sigh/lib/sigh/download_all.rb