Class: Fastlane::Actions::ProduceAction

Inherits:
Object
  • Object
show all
Defined in:
lib/fastlane/actions/produce.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
29
30
31
32
# File 'lib/fastlane/actions/produce.rb', line 8

def self.run(params)
  require 'produce'
  
  hash = params.first || {}
  raise "Parameter of produce must be a hash".red unless hash.kind_of?Hash

  hash.each do |key, value|
    ENV[key.to_s.upcase] = value.to_s
  end

  return if Helper.is_test?

  Dir.chdir(FastlaneFolder.path || Dir.pwd) do
    # This should be executed in the fastlane folder
    
    CredentialsManager::PasswordManager.shared_manager(ENV['PRODUCE_USERNAME']) if ENV['PRODUCE_USERNAME']
    Produce::Config.shared_config # to ask for missing information right in the beginning
    
    apple_id = Produce::Manager.start_producing.to_s


    Actions.lane_context[SharedValues::PRODUCE_APPLE_ID] = apple_id
    ENV["PRODUCE_APPLE_ID"] = apple_id
  end
end