Sha256: 57ef60c5cc593b8dd7023f50f2551ceb4556ff62f2b96cf1ff0db4316f404c5c

Contents?: true

Size: 1.5 KB

Versions: 206

Compression:

Stored size: 1.5 KB

Contents

module Sigh
  class DownloadAll
    # Download all valid provisioning profiles
    def download_all(download_xcode_profiles: false)
      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(xcode: download_xcode_profiles).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

      if download_xcode_profiles
        UI.message("This run also included all Xcode managed provisioning profiles, as you used the `--download_xcode_profiles` flag")
      else
        UI.message("All Xcode managed provisioning profiles were ignored on this, to include them use the `--download_xcode_profiles` flag")
      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

206 entries across 206 versions & 1 rubygems

Version Path
fastlane-2.70.3 sigh/lib/sigh/download_all.rb
fastlane-2.71.0.beta.20171221010003 sigh/lib/sigh/download_all.rb
fastlane-2.70.2 sigh/lib/sigh/download_all.rb
fastlane-2.71.0.beta.20171220010004 sigh/lib/sigh/download_all.rb
fastlane-2.71.0.beta.20171219010003 sigh/lib/sigh/download_all.rb
fastlane-2.70.1 sigh/lib/sigh/download_all.rb
fastlane-2.70.0 sigh/lib/sigh/download_all.rb
fastlane-2.70.0.beta.20171217010003 sigh/lib/sigh/download_all.rb
fastlane-2.70.0.beta.20171216010003 sigh/lib/sigh/download_all.rb
fastlane-2.70.0.beta.20171215010003 sigh/lib/sigh/download_all.rb
fastlane-2.69.3 sigh/lib/sigh/download_all.rb
fastlane-2.70.0.beta.20171214010003 sigh/lib/sigh/download_all.rb
fastlane-2.69.2 sigh/lib/sigh/download_all.rb
fastlane-2.69.1 sigh/lib/sigh/download_all.rb
fastlane-2.70.0.beta.20171213010003 sigh/lib/sigh/download_all.rb
fastlane-2.69.0 sigh/lib/sigh/download_all.rb
fastlane-2.69.0.beta.20171212010004 sigh/lib/sigh/download_all.rb
fastlane-2.69.0.beta.20171211010003 sigh/lib/sigh/download_all.rb
fastlane-2.69.0.beta.20171210010003 sigh/lib/sigh/download_all.rb
fastlane-2.69.0.beta.20171209010003 sigh/lib/sigh/download_all.rb