<commit_before>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<commit_msg>[Sigh] download_all name file using profile UUID instead of application bundle identifier (#8082)<commit_after>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
{'fraction_non_alphanumeric': 0.10133444537114263, 'fraction_numerical': 0.0016680567139282735, 'mean_word_length': 3.107876712328767, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 15, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3841262', 'n_tokens_mistral': 730, 'n_tokens_neox': 711, 'n_words': 153}