Class: Fastlane::Actions::ShAction

Inherits:
Fastlane::Action show all
Defined in:
fastlane/lib/fastlane/actions/sh.rb

Constant Summary

Constants inherited from Fastlane::Action

Fastlane::Action::AVAILABLE_CATEGORIES, Fastlane::Action::RETURN_TYPES

Documentation collapse

Class Method Summary collapse

Methods inherited from Fastlane::Action

action_name, author, deprecated_notes, lane_context, method_missing, other_action, output, sample_return_value, shell_out_should_use_bundle_exec?, step_text

Class Method Details

.authorsObject



49
50
51
# File 'fastlane/lib/fastlane/actions/sh.rb', line 49

def self.authors
  ["KrauseFx"]
end

.available_optionsObject



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'fastlane/lib/fastlane/actions/sh.rb', line 23

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :command,
                                   description: 'Shell command to be executed',
                                   optional: false),
    FastlaneCore::ConfigItem.new(key: :log,
                                   description: 'Determines whether fastlane should print out the executed command itself and output of the executed command. If command line option --troubleshoot is used, then it overrides this option to true',
                                   optional: true,
                                   type: Boolean,
                                   default_value: true),
    FastlaneCore::ConfigItem.new(key: :error_callback,
                                   description: 'A callback invoked with the command output if there is a non-zero exit status',
                                   optional: true,
                                   type: :string_callback,
                                   default_value: nil)
  ]
end

.categoryObject



64
65
66
# File 'fastlane/lib/fastlane/actions/sh.rb', line 64

def self.category
  :misc
end

.descriptionObject



12
13
14
# File 'fastlane/lib/fastlane/actions/sh.rb', line 12

def self.description
  "Runs a shell command"
end

.detailsObject



16
17
18
19
20
21
# File 'fastlane/lib/fastlane/actions/sh.rb', line 16

def self.details
  [
    "Allows running an arbitrary shell command.",
    "Be aware of a specific behavior of `sh` action with regard to the working directory. For details, refer to [Advanced](https://docs.fastlane.tools/advanced/#directory-behavior)."
  ].join("\n")
end

.example_codeObject



57
58
59
60
61
62
# File 'fastlane/lib/fastlane/actions/sh.rb', line 57

def self.example_code
  [
    'sh("ls")',
    'sh("git", "commit", "-m", "My message")'
  ]
end

.is_supported?(platform) ⇒ Boolean

Returns:



53
54
55
# File 'fastlane/lib/fastlane/actions/sh.rb', line 53

def self.is_supported?(platform)
  true
end

.return_typeObject



45
46
47
# File 'fastlane/lib/fastlane/actions/sh.rb', line 45

def self.return_type
  :string
end

.return_valueObject



41
42
43
# File 'fastlane/lib/fastlane/actions/sh.rb', line 41

def self.return_value
  'Outputs the string and executes it. When running in tests, it returns the actual command instead of executing it'
end

.run(params) ⇒ Object



4
5
6
# File 'fastlane/lib/fastlane/actions/sh.rb', line 4

def self.run(params)
  # this is implemented in the sh_helper.rb
end