aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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