Class: Homebrew::Cmd::Developer::StateSubcommand Private

Inherits:
AbstractSubcommand show all
Defined in:
developer/subcommand/state.rb

This class is part of a private API. This class may only be used in the Homebrew/brew repository. Third parties should avoid using this class if possible, as it may be removed or changed without warning.

Instance Attribute Summary

Attributes inherited from AbstractSubcommand

#args, #cleanup, #context, #quiet, #targets

Instance Method Summary collapse

Methods inherited from AbstractSubcommand

define, define_all, #initialize, subcommand_name, subcommands_for

Methods included from Utils::Output::Mixin

#issue_reporting_message, #odebug, #odeprecated, #odie, #odisabled, #ofail, #oh1, #oh1_title, #ohai, #ohai_title, #onoe, #opoo, #opoo_outside_github_actions, #pretty_deprecated, #pretty_disabled, #pretty_duration, #pretty_install_status, #pretty_installed, #pretty_outdated, #pretty_uninstalled, #pretty_upgradable

Constructor Details

This class inherits a constructor from Homebrew::AbstractSubcommand

Instance Method Details

#runvoid

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

This method returns an undefined value.



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'developer/subcommand/state.rb', line 21

def run
  if Homebrew::EnvConfig.developer?
    puts "Developer mode is enabled because #{Tty.bold}HOMEBREW_DEVELOPER#{Tty.reset} is set."
  elsif Homebrew::EnvConfig.devcmdrun?
    puts "Developer mode is enabled because a developer command or `brew developer on` was run."
  else
    puts "Developer mode is disabled."
  end

  if Homebrew::EnvConfig.developer? || Homebrew::EnvConfig.devcmdrun?
    if Homebrew::EnvConfig.update_to_tag?
      puts "However, `brew update` will update to the latest stable tag because " \
           "#{Tty.bold}HOMEBREW_UPDATE_TO_TAG#{Tty.reset} is set."
    else
      puts "`brew update` will update to the latest commit on the `main` branch."
    end
  else
    puts "`brew update` will update to the latest stable tag."
  end
end