Prettier brew versions output

This commit is contained in:
Max Howell 2011-08-02 14:45:37 +01:00
parent f576cae37a
commit 48501e8e1f

View File

@ -24,7 +24,7 @@ module Homebrew extend self
print Tty.white
print "#{version.ljust(8)} "
print Tty.reset
puts "git checkout #{sha} #{HOMEBREW_REPOSITORY}/Library/Formula/#{f.name}.rb"
puts "git checkout #{sha} #{f.pretty_relative_path}"
end
end
end
@ -63,4 +63,11 @@ class Formula
opoo "Version of #{name} could not be determined for #{sha}."
end
def pretty_relative_path
if Pathname.pwd == HOMEBREW_REPOSITORY
"Library/Formula/#{name}.rb"
else
"#{HOMEBREW_REPOSITORY}/Library/Formula/#{name}.rb"
end
end
end