mirror of
https://github.com/mistydemeo/tigerbrew.git
synced 2026-12-02 05:29:47 -05:00
Better conflict warnings when tapping
This commit is contained in:
1 parent
f9c87aecc3
commit
0ec3aefcfe
1 file changed
+17
-1
@@ -36,7 +36,9 @@ module Homebrew extend self
|
||||
if $?.success?
|
||||
ignores << formula.basename.to_s
|
||||
else
|
||||
opoo "#{formula.basename('.rb')} conflicts"
|
||||
from = Pathname.new("../Taps").join(formula).tap_ref
|
||||
to = HOMEBREW_LIBRARY.join("Formula/#{formula.basename}").tap_ref
|
||||
opoo "Could not tap #{Tty.white}#{from}#{Tty.reset} over #{Tty.white}#{to}#{Tty.reset}"
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -56,3 +58,17 @@ module Homebrew extend self
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
class Pathname
|
||||
def tap_ref
|
||||
case self.realpath.to_s
|
||||
when %r{^#{HOMEBREW_LIBRARY}/Taps/(\w+)-(\w+)/(.+)}
|
||||
"#$1/#$2/#{File.basename($3, '.rb')}"
|
||||
when %r{^#{HOMEBREW_LIBRARY}/Formula/(.+)}
|
||||
"mxcl/master/#{File.basename($1, '.rb')}"
|
||||
else
|
||||
self.basenname('.rb').to_s
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user