Sha256: 0279ba000755655ac2ca3f4b044c5c13d409a17505efb1414fd6ca8f6517183e

Contents?: true

Size: 1.05 KB

Versions: 12

Compression:

Stored size: 1.05 KB

Contents

module Sigh
  class Repair
    def repair_all
      Helper.log.info "Starting login with user '#{Sigh.config[:username]}'"
      Spaceship.login(Sigh.config[:username], nil)
      Spaceship.select_team
      Helper.log.info "Successfully logged in"

      # Select all 'Invalid' or 'Expired' provisioning profiles
      broken_profiles = Spaceship.provisioning_profile.all.find_all do |profile|
        (profile.status == "Invalid" or profile.status == "Expired")
      end

      if broken_profiles.count == 0
        Helper.log.info "All provisioning profiles are valid, nothing to do".green
        return
      end

      Helper.log.info "Going to repair #{broken_profiles.count} provisioning profiles".green

      # Iterate over all broken profiles and repair them
      broken_profiles.each do |profile|
        Helper.log.info "Repairing profile '#{profile.name}'..."
        profile.repair! # yes, that's all you need to repair a profile
      end

      Helper.log.info "Successfully repaired #{broken_profiles.count} provisioning profiles".green
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
sigh-1.3.0 lib/sigh/repair.rb
sigh-1.2.2 lib/sigh/repair.rb
sigh-1.2.1 lib/sigh/repair.rb
sigh-1.2.0 lib/sigh/repair.rb
sigh-1.1.4 lib/sigh/repair.rb
sigh-1.1.3 lib/sigh/repair.rb
sigh-1.1.2 lib/sigh/repair.rb
sigh-1.1.1 lib/sigh/repair.rb
sigh-1.1.0 lib/sigh/repair.rb
sigh-1.0.0 lib/sigh/repair.rb
sigh-0.10.9 lib/sigh/repair.rb
sigh-0.10.8 lib/sigh/repair.rb