2010-09-11 20:22:54 +01:00
|
|
|
module Homebrew extend self
|
|
|
|
def link
|
2012-02-04 00:01:29 -06:00
|
|
|
raise KegUnspecifiedError if ARGV.named.empty?
|
|
|
|
|
2012-03-04 02:47:53 +00:00
|
|
|
if Process.uid.zero? and not File.stat(HOMEBREW_BREW_FILE).uid.zero?
|
|
|
|
# note we only abort if Homebrew is *not* installed as sudo and the user
|
|
|
|
# calls brew as root. The fix is to chown brew to root.
|
|
|
|
abort "Cowardly refusing to `sudo brew link'"
|
|
|
|
end
|
|
|
|
|
2010-09-11 20:22:54 +01:00
|
|
|
ARGV.kegs.each do |keg|
|
|
|
|
print "Linking #{keg}... "
|
2012-02-01 22:15:07 -06:00
|
|
|
puts if ARGV.verbose?
|
2012-03-06 13:02:10 +00:00
|
|
|
puts "#{keg.link} symlinks created"
|
2010-09-11 20:22:54 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|