Class: Fastlane::Actions::BrewAction

Inherits:
Action
  • Object
show all
Defined in:
lib/fastlane/plugin/brew/actions/brew_action.rb

Documentation collapse

Class Method Summary collapse

Class Method Details

.authorsObject



42
43
44
# File 'lib/fastlane/plugin/brew/actions/brew_action.rb', line 42

def self.authors
  ["Michael Ruhl"]
end

.available_optionsObject



27
28
29
30
31
32
33
34
# File 'lib/fastlane/plugin/brew/actions/brew_action.rb', line 27

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :command,
                                 description: "Brew command to be executed",
                                 optional: false,
                                 is_string: true)
  ]
end

.descriptionObject



19
20
21
# File 'lib/fastlane/plugin/brew/actions/brew_action.rb', line 19

def self.description
  "Run Homebrew/Linuxbrew command"
end

.detailsObject



23
24
25
# File 'lib/fastlane/plugin/brew/actions/brew_action.rb', line 23

def self.details
  'Example: brew("install imagemagick")'
end

.example_codeObject



36
37
38
39
40
# File 'lib/fastlane/plugin/brew/actions/brew_action.rb', line 36

def self.example_code
  [
    'brew("install imagemagick")'
  ]
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


46
47
48
# File 'lib/fastlane/plugin/brew/actions/brew_action.rb', line 46

def self.is_supported?(platform)
  true
end

.run(params) ⇒ Object



4
5
6
7
8
9
10
11
12
13
# File 'lib/fastlane/plugin/brew/actions/brew_action.rb', line 4

def self.run(params)
  Actions.sh("which brew", log: false, error_callback: proc do |error_output|
    UI.user_error!("Homebrew/Linuxbrew is not installed")
  end)

  UI.command("brew #{params[:command]}")
  FastlaneCore::CommandExecutor.execute(command: 'env -i HOME="$HOME" TERM="$TERM" LC_CTYPE="${LC_ALL:-${LC_CTYPE:-$LANG}}" PATH="$PATH" USER="$USER" brew ' + params[:command],
                                        print_all: true,
                                        print_command: false)
end