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



51
52
53
# File 'fastlane/lib/fastlane/actions/sh.rb', line 51

def self.authors
  ["KrauseFx"]
end

.available_optionsObject



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# 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,
                                   is_string: true),
    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,
                                   is_string: false,
                                   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,
                                   is_string: false,
                                   type: :string_callback,
                                   default_value: nil)
  ]
end

.categoryObject



66
67
68
# File 'fastlane/lib/fastlane/actions/sh.rb', line 66

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



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

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

.is_supported?(platform) ⇒ Boolean

Returns:



55
56
57
# File 'fastlane/lib/fastlane/actions/sh.rb', line 55

def self.is_supported?(platform)
  true
end

.return_typeObject



47
48
49
# File 'fastlane/lib/fastlane/actions/sh.rb', line 47

def self.return_type
  :string
end

.return_valueObject



43
44
45
# File 'fastlane/lib/fastlane/actions/sh.rb', line 43

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