38 lines
902 B
Ruby
Raw Normal View History

#: * `--env`:
#: Show a summary of the Homebrew build environment.
2014-06-19 17:57:36 -05:00
require "extend/ENV"
require "build_environment"
2016-08-10 23:19:09 -07:00
require "utils/shell"
module Homebrew
2016-09-26 01:44:51 +02:00
module_function
def __env
2013-08-19 12:32:56 -05:00
ENV.activate_extensions!
ENV.deps = ARGV.formulae if superenv?
ENV.setup_build_environment
ENV.universal_binary if ARGV.build_universal?
2016-08-10 23:19:09 -07:00
shell_value = ARGV.value("shell")
if ARGV.include?("--plain")
2016-08-10 23:19:09 -07:00
shell = nil
elsif shell_value.nil?
# legacy behavior
shell = :bash unless $stdout.tty?
elsif shell_value == "auto"
shell = Utils::Shell.parent_shell || Utils::Shell.preferred_shell
elsif shell_value
shell = Utils::Shell.path_to_shell(shell_value)
end
env_keys = build_env_keys(ENV)
if shell.nil?
dump_build_env ENV
else
2016-08-10 23:19:09 -07:00
env_keys.each { |key| puts Utils::Shell.export_value(shell, key, ENV[key]) }
end
end
end