Sha256: c1d2158235c6f0bb7c68a082723cff96cd9bc147a606e530362fa95a1d390060

Contents?: true

Size: 1.47 KB

Versions: 162

Compression:

Stored size: 1.47 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
          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

162 entries across 162 versions & 1 rubygems

Version Path
fastlane-2.24.0.beta.20170328010037 fastlane/lib/fastlane/one_off.rb
fastlane-2.24.0.beta.20170327010009 fastlane/lib/fastlane/one_off.rb
fastlane-2.24.0.beta.20170326010023 fastlane/lib/fastlane/one_off.rb
fastlane-2.24.0.beta.20170325010032 fastlane/lib/fastlane/one_off.rb
fastlane-2.23.0 fastlane/lib/fastlane/one_off.rb
fastlane-2.23.0.beta.20170322010036 fastlane/lib/fastlane/one_off.rb
fastlane-2.22.0 fastlane/lib/fastlane/one_off.rb
fastlane-2.22.0.beta.20170321010023 fastlane/lib/fastlane/one_off.rb
fastlane-2.21.0 fastlane/lib/fastlane/one_off.rb
fastlane-2.21.0.beta.20170320010043 fastlane/lib/fastlane/one_off.rb
fastlane-2.21.0.beta.20170319010027 fastlane/lib/fastlane/one_off.rb
fastlane-2.21.0.beta.20170318010107 fastlane/lib/fastlane/one_off.rb
fastlane-2.21.0.beta.20170317010039 fastlane/lib/fastlane/one_off.rb
fastlane-2.21.0.beta.20170316010039 fastlane/lib/fastlane/one_off.rb
fastlane-2.20.0 fastlane/lib/fastlane/one_off.rb
fastlane-2.20.0.beta.20170315010053 fastlane/lib/fastlane/one_off.rb
fastlane-2.20.0.beta.20170314010029 fastlane/lib/fastlane/one_off.rb
fastlane-2.20.0.beta.20170313010048 fastlane/lib/fastlane/one_off.rb
fastlane-2.20.0.beta.20170312010035 fastlane/lib/fastlane/one_off.rb
fastlane-2.20.0.beta.20170311010030 fastlane/lib/fastlane/one_off.rb