Class: Homebrew::Cmd::Env Private
- Inherits:
-
AbstractCommand
- Object
- AbstractCommand
- Homebrew::Cmd::Env
- Defined in:
- cmd/--env.rb,
sorbet/rbi/dsl/homebrew/cmd/env.rbi
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.
Defined Under Namespace
Classes: Args
Class Method Summary collapse
- .command_name ⇒ String private
Instance Method Summary collapse
- #args ⇒ Homebrew::Cmd::Env::Args private
- #run ⇒ void private
Methods inherited from AbstractCommand
command, dev_cmd?, #initialize, parser, ruby_cmd?
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, #opoo_without_github_actions_annotation, #pretty_cannot_install, #pretty_deprecated, #pretty_disabled, #pretty_duration, #pretty_install_status, #pretty_installed, #pretty_uninstalled, #pretty_unmarked, #pretty_upgradable, #pretty_warning
Constructor Details
This class inherits a constructor from Homebrew::AbstractCommand
Class Method Details
.command_name ⇒ String
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.
15 |
# File 'cmd/--env.rb', line 15 def self.command_name = "--env" |
Instance Method Details
#args ⇒ Homebrew::Cmd::Env::Args
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.
10 |
# File 'sorbet/rbi/dsl/homebrew/cmd/env.rbi', line 10 def args; end |
#run ⇒ void
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.
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'cmd/--env.rb', line 34 def run ENV.activate_extensions! ENV.deps = args.named.to_formulae if Superenv.enabled_for?(nil) ENV.setup_build_environment shell_arg = args.shell shell = if args.plain? nil elsif shell_arg.nil? :bash unless $stdout.tty? elsif shell_arg == "auto" Utils::Shell.parent || Utils::Shell.preferred else Utils::Shell.from_path(shell_arg) end if shell.nil? BuildEnvironment.dump ENV.to_h else BuildEnvironment.keys(ENV.to_h).each do |key| puts Utils::Shell.export_value(key, ENV.fetch(key), shell) end end end |