Sha256: f17cefdd979c28adc5121956b5ee255f1c2ef8ac1d4452460ccd6764db1131b7

Contents?: true

Size: 971 Bytes

Versions: 2

Compression:

Stored size: 971 Bytes

Contents

module Fastlane
  class ConfigurationHelper
    def self.parse(action, params)
      begin
        first_element = (action.available_options.first rescue nil) # might also be nil
        
        if first_element and first_element.kind_of?FastlaneCore::ConfigItem
          # default use case
          return FastlaneCore::Configuration.create(action.available_options, params)

        elsif first_element
          puts "Old configuration format for action '#{action}'".red if Helper.is_test?
          return params
        else

          # No parameters... we still need the configuration object array
          FastlaneCore::Configuration.create(action.available_options, {})

        end
      rescue => ex
        Helper.log.fatal "You invalid parameters to '#{action.action_name}'.".red
        Helper.log.fatal "Check out the error below and available options by running `fastlane action #{action.action_name}`".red
        raise ex
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fastlane-0.12.3 lib/fastlane/configuration_helper.rb
fastlane-0.12.2 lib/fastlane/configuration_helper.rb