aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Howell2011-08-02 14:45:37 +0100
committerMax Howell2011-08-02 14:45:37 +0100
commit48501e8e1f9af4ef093efdd3183cd65ba4c381fc (patch)
tree41009b0f42f9152b4f9eb71baa6d3ceecf601dff
parentf576cae37ae40b2d909a7da784ae6999e0e5dea4 (diff)
downloadbrew-48501e8e1f9af4ef093efdd3183cd65ba4c381fc.tar.bz2
Prettier `brew versions` output
-rw-r--r--Library/Homebrew/cmd/versions.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/Library/Homebrew/cmd/versions.rb b/Library/Homebrew/cmd/versions.rb
index 25ca1afd5..e35eb6382 100644
--- a/Library/Homebrew/cmd/versions.rb
+++ b/Library/Homebrew/cmd/versions.rb
@@ -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