Sha256: 624c6a0d33cfd7d957eaf08d0f0b4dae5a97f556d1e6d1262ecd163508bc3646

Contents?: true

Size: 1.52 KB

Versions: 656

Compression:

Stored size: 1.52 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)
          UI.user_error!("Please pass values like this: key:value") unless key.length > 0
          value = CommandLineHandler.convert_value(value)
          UI.verbose("Using #{key}: #{value}")
          action_parameters[key.to_sym] = value
        else
          action_name ||= current
        end
      end

      UI.crash!("invalid syntax") unless action_name

      run(action: action_name,
          parameters: action_parameters)
    end

    def self.run(action: nil, parameters: nil)
      Fastlane.load_actions

      class_ref = Actions.action_class_ref(action)
      unless class_ref
        if Fastlane::Actions.formerly_bundled_actions.include?(action)
          # This was a formerly bundled action which is now a plugin.
          UI.verbose(caller.join("\n"))
          UI.user_error!("The action '#{action}' is no longer bundled with fastlane. You can install it using `fastlane add_plugin #{action}`")
        else
          Fastlane::ActionsList.print_suggestions(action)
          UI.user_error!("Action '#{action}' not available, run `fastlane actions` to get a full list")
        end
      end

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

Version data entries

656 entries across 656 versions & 5 rubygems

Version Path
fastlane-2.86.0.beta.20180311050103 fastlane/lib/fastlane/one_off.rb
fastlane-2.86.0.beta.20180310050010 fastlane/lib/fastlane/one_off.rb
fastlane-2.86.0.beta.20180309050025 fastlane/lib/fastlane/one_off.rb
fastlane-2.85.0 fastlane/lib/fastlane/one_off.rb
fastlane-2.85.0.beta.20180308050114 fastlane/lib/fastlane/one_off.rb
fastlane-2.85.0.beta.20180307050101 fastlane/lib/fastlane/one_off.rb
fastlane-2.85.0.beta.20180306050019 fastlane/lib/fastlane/one_off.rb
fastlane-2.85.0.beta.20180305050037 fastlane/lib/fastlane/one_off.rb
fastlane-2.85.0.beta.20180304050031 fastlane/lib/fastlane/one_off.rb
fastlane-2.85.0.beta.20180303050048 fastlane/lib/fastlane/one_off.rb
fastlane-2.85.0.beta.20180302050035 fastlane/lib/fastlane/one_off.rb
fastlane-2.84.0 fastlane/lib/fastlane/one_off.rb
fastlane-2.84.0.beta.20180301050048 fastlane/lib/fastlane/one_off.rb
fastlane-2.84.0.beta.20180228050122 fastlane/lib/fastlane/one_off.rb
fastlane-2.84.0.beta.20180227050054 fastlane/lib/fastlane/one_off.rb
fastlane-2.83.0 fastlane/lib/fastlane/one_off.rb
fastlane-2.83.0.beta.20180226050016 fastlane/lib/fastlane/one_off.rb
fastlane-2.83.0.beta.20180225050035 fastlane/lib/fastlane/one_off.rb
fastlane-2.83.0.beta.20180224050047 fastlane/lib/fastlane/one_off.rb
fastlane-2.82.0 fastlane/lib/fastlane/one_off.rb