Sha256: 2ba76d8bcf2a0622b6d7d3c489ddc2c6e04fb6fd9ec4d933ebb9bb56bf49a882

Contents?: true

Size: 1.54 KB

Versions: 306

Compression:

Stored size: 1.54 KB

Contents

require_relative 'module'
require_relative 'storage'

module Match
  class Setup
    def run(path, is_swift_fastfile: false)
      if is_swift_fastfile
        template = File.read("#{Match::ROOT}/lib/assets/MatchfileTemplate.swift")
      else
        template = File.read("#{Match::ROOT}/lib/assets/MatchfileTemplate")
      end

      storage_mode = UI.select(
        "fastlane match supports multiple storage modes, please select the one you want to use:",
        self.storage_options
      )

      storage = Storage.for_mode(storage_mode, {})

      specific_content = storage.generate_matchfile_content
      UI.crash!("Looks like `generate_matchfile_content` was `nil` for `#{storage_mode}`") if specific_content.nil?
      specific_content += "\n\n" if specific_content.length > 0
      specific_content += "storage_mode(\"#{storage_mode}\")"

      template.gsub!("[[CONTENT]]", specific_content)

      File.write(path, template)
      UI.success("Successfully created '#{path}'. You can open the file using a code editor.")

      UI.important("You can now run `fastlane match development`, `fastlane match adhoc`, `fastlane match enterprise` and `fastlane match appstore`")
      UI.message("On the first run for each environment it will create the provisioning profiles and")
      UI.message("certificates for you. From then on, it will automatically import the existing profiles.")
      UI.message("For more information visit https://docs.fastlane.tools/actions/match/")
    end

    def storage_options
      return ["git", "google_cloud"]
    end
  end
end

Version data entries

306 entries across 306 versions & 2 rubygems

Version Path
fastlane-2.129.0.beta.20190726200041 match/lib/match/setup.rb
fastlane-2.128.1 match/lib/match/setup.rb
fastlane-2.129.0.beta.20190725200033 match/lib/match/setup.rb
fastlane-2.129.0.beta.20190723200012 match/lib/match/setup.rb
fastlane-2.128.0 match/lib/match/setup.rb
fastlane-2.128.0.beta.20190722200021 match/lib/match/setup.rb
fastlane-2.128.0.beta.20190721200024 match/lib/match/setup.rb
fastlane-2.128.0.beta.20190720200049 match/lib/match/setup.rb
fastlane_iac_publish-0.1.5 match/lib/match/setup.rb
fastlane-2.127.2 match/lib/match/setup.rb
fastlane-2.128.0.beta.20190719200019 match/lib/match/setup.rb
fastlane-2.128.0.beta.20190718200101 match/lib/match/setup.rb
fastlane-2.128.0.beta.20190717200026 match/lib/match/setup.rb
fastlane-2.128.0.beta.20190716200022 match/lib/match/setup.rb
fastlane-2.128.0.beta.20190715200056 match/lib/match/setup.rb
fastlane-2.128.0.beta.20190714200028 match/lib/match/setup.rb
fastlane-2.128.0.beta.20190713200107 match/lib/match/setup.rb
fastlane-2.128.0.beta.20190712200059 match/lib/match/setup.rb
fastlane-2.128.0.beta.20190711200117 match/lib/match/setup.rb
fastlane-2.127.1 match/lib/match/setup.rb