Class: Fastlane::Actions::UpdateProjectCodeSigningAction

Inherits:
Object
  • Object
show all
Defined in:
lib/fastlane/actions/update_project_code_signing.rb

Class Method Summary collapse

Class Method Details

.run(params) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/fastlane/actions/update_project_code_signing.rb', line 7

def self.run(params)
  path = params.first
  path = File.join(path, "project.pbxproj")
  raise "Could not find path to project config '#{path}'. Pass the path to your project (not workspace)!".red unless File.exists?(path)

  udid = (params[1] rescue nil)
  udid ||= ENV["SIGH_UDID"]

  Helper.log.info("Updating provisioning profile UDID (#{udid}) for the given project '#{path}'")

  p = File.read(path)
  File.write(path, p.gsub(/PROVISIONING_PROFILE = ".*";/, "PROVISIONING_PROFILE = \"#{udid}\";"))

  Helper.log.info("Successfully updated project settings to use UDID '#{udid}'".green)
end