aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd/sh.rb
blob: e62ef90c95c63ee1ca6b9b7f69ef5b599eb6b08d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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