Sha256: fc21b4c16a1b7597e6e3840ef62d1e69027b2e732b6338899b64998783d82268

Contents?: true

Size: 1.01 KB

Versions: 53

Compression:

Stored size: 1.01 KB

Contents

module Fastlane
  # Call actions without triggering a full lane
  class OneOff
    def self.execute(args: nil)
      action_parameters = {}
      action_name = nil

      args.each do |current|
        if current.include? ":" # that's a key/value which we want to pass to the lane
          key, value = current.split(":", 2)
          raise "Please pass values like this: key:value" unless key.length > 0
          value = CommandLineHandler.convert_value(value)
          Helper.log.debug "Using #{key}: #{value}".yellow
          action_parameters[key.to_sym] = value
        else
          action_name ||= current
        end
      end

      raise "invalid syntax" unless action_name

      class_name = action_name.fastlane_class + 'Action'
      class_ref = nil
      begin
        class_ref = Fastlane::Actions.const_get(class_name)
      rescue NameError
        raise "Action not found"
      end

      r = Runner.new
      r.execute_action(action_name, class_ref, [action_parameters], custom_dir: '.')
    end
  end
end

Version data entries

53 entries across 53 versions & 1 rubygems

Version Path
fastlane-1.66.0 lib/fastlane/one_off.rb
fastlane-1.65.0 lib/fastlane/one_off.rb
fastlane-1.64.0 lib/fastlane/one_off.rb
fastlane-1.63.1 lib/fastlane/one_off.rb
fastlane-1.63.0 lib/fastlane/one_off.rb
fastlane-1.62.0 lib/fastlane/one_off.rb
fastlane-1.61.0 lib/fastlane/one_off.rb
fastlane-1.60.0 lib/fastlane/one_off.rb
fastlane-1.59.0 lib/fastlane/one_off.rb
fastlane-1.58.0 lib/fastlane/one_off.rb
fastlane-1.57.0 lib/fastlane/one_off.rb
fastlane-1.56.0 lib/fastlane/one_off.rb
fastlane-1.55.0 lib/fastlane/one_off.rb
fastlane-1.54.0 lib/fastlane/one_off.rb
fastlane-1.53.0 lib/fastlane/one_off.rb
fastlane-1.52.0 lib/fastlane/one_off.rb
fastlane-1.51.0 lib/fastlane/one_off.rb
fastlane-1.50.0 lib/fastlane/one_off.rb
fastlane-1.49.0 lib/fastlane/one_off.rb
fastlane-1.48.0 lib/fastlane/one_off.rb