Sha256: af3aa5a1ce7b30d83e9a3d44ccffc096cbf6007b46c8ff1c63f14ab586a545cc

Contents?: true

Size: 1.04 KB

Versions: 2

Compression:

Stored size: 1.04 KB

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
          Helper.log.error "Action '#{action}' uses the old configuration format."
          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 provided an option to action #{action.action_name} which is not supported.".red
        Helper.log.fatal "Check out the available options below or run `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.1 lib/fastlane/configuration_helper.rb
fastlane-0.12.0 lib/fastlane/configuration_helper.rb