Sha256: 2ed765f7e4f5024db602de0432601309b21f8871d981203d2e99048cfa313623

Contents?: true

Size: 1.11 KB

Versions: 228

Compression:

Stored size: 1.11 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.uuid}_#{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

228 entries across 228 versions & 1 rubygems

Version Path
fastlane-2.38.0 sigh/lib/sigh/download_all.rb
fastlane-2.38.0.beta.20170612010035 sigh/lib/sigh/download_all.rb
fastlane-2.38.0.beta.20170611010050 sigh/lib/sigh/download_all.rb
fastlane-2.38.0.beta.20170610010032 sigh/lib/sigh/download_all.rb
fastlane-2.38.0.beta.20170609010035 sigh/lib/sigh/download_all.rb
fastlane-2.38.0.beta.20170608010030 sigh/lib/sigh/download_all.rb
fastlane-2.38.0.beta.20170607010024 sigh/lib/sigh/download_all.rb
fastlane-2.38.0.beta.20170606010029 sigh/lib/sigh/download_all.rb
fastlane-2.37.0 sigh/lib/sigh/download_all.rb
fastlane-2.37.0.beta.20170605010054 sigh/lib/sigh/download_all.rb
fastlane-2.37.0.beta.20170604010021 sigh/lib/sigh/download_all.rb
fastlane-2.37.0.beta.20170603010102 sigh/lib/sigh/download_all.rb
fastlane-2.37.0.beta.20170602010027 sigh/lib/sigh/download_all.rb
fastlane-2.37.0.beta.20170601010043 sigh/lib/sigh/download_all.rb
fastlane-2.36.0 sigh/lib/sigh/download_all.rb
fastlane-2.36.0.beta.20170531010050 sigh/lib/sigh/download_all.rb
fastlane-2.36.0.beta.20170530010040 sigh/lib/sigh/download_all.rb
fastlane-2.36.0.beta.20170529010025 sigh/lib/sigh/download_all.rb
fastlane-2.36.0.beta.20170528010028 sigh/lib/sigh/download_all.rb
fastlane-2.36.0.beta.20170527010029 sigh/lib/sigh/download_all.rb