Skip to content
Snippets Groups Projects
Commit bdd61935 authored by Max Howell's avatar Max Howell
Browse files

`brew sh`: a shell with superenv loaded

If you need to build software on OS X by hand, a brew shell is the way to do it.

Closes Homebrew/homebrew#14381.
parent a360a414
No related branches found
No related tags found
No related merge requests found
require 'superenv'
require 'formula'
module Homebrew extend self
def sh
if superenv?
ENV.x11 = true
ENV.deps = Formula.installed.select{|f| f.keg_only? and f.opt_prefix.directory? }.map(&:name)
end
ENV.setup_build_environment
ENV['PS1'] = 'brew \[\033[1;32m\]\w\[\033[0m\]$ '
puts <<-EOS.undent_________________________________________________________72
Your shell has been configured to use Homebrew's build environment: this
should help you build stuff. Notably though, the system versions of gem
and pip will ignore our configuration and insist on using the
environment they were built under (mostly). Sadly, scons will also
ignore our configuration.
When done, type `exit'.
EOS
exec ENV['SHELL']
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment