blob: 302c7c3bce32e88ddf93bbecf14c3334e8b10be0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
require "formula"
require "formula_versions"
module Homebrew extend self
def versions
raise "Please `brew install git` first" unless which "git"
raise "Please `brew update` first" unless (HOMEBREW_REPOSITORY/".git").directory?
raise FormulaUnspecifiedError if ARGV.named.empty?
opoo <<-EOS.undent
brew-versions is unsupported and may be removed soon.
Please use the homebrew-versions tap instead:
https://github.com/Homebrew/homebrew-versions
EOS
ARGV.formulae.all? do |f|
versions = FormulaVersions.new(f)
path = versions.repository_path
versions.each do |version, rev|
print "#{Tty.white}#{version.to_s.ljust(8)}#{Tty.reset} "
puts "git checkout #{rev} #{path}"
end
end
end
end
|