Class: Fastlane::Actions::SighAction

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

Class Method Summary collapse

Class Method Details

.run(params) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/fastlane/actions/sigh.rb', line 8

def self.run(params)
  require 'sigh'
  require 'credentials_manager/appfile_config'

  type = Sigh::DeveloperCenter::APPSTORE
  type = Sigh::DeveloperCenter::ADHOC if params.include? :adhoc
  type = Sigh::DeveloperCenter::DEVELOPMENT if params.include? :development
  
  return type if Helper.is_test?

  app = CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier)
  raise "No app_identifier definied in `./fastlane/Appfile`".red unless app

  path = Sigh::DeveloperCenter.new.run(app, type)
  output_path = File.expand_path(File.join('.', File.basename(path)))
  FileUtils.mv(path, output_path)
  Helper.log.info "Exported provisioning profile to '#{output_path}'".green
  Actions.sh "open '#{output_path}'" unless params.include? :skip_install

  Actions.lane_context[SharedValues::SIGH_PROFILE_PATH] = output_path # absolute URL
end