1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/tool/fetch-bundled_gems.rb
nobu ef82d94873 test-bundled-gems-fetch
* tool/fetch-bundled_gems.rb: get rid of tool/git-refresh which
  requries Bourne shell.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-25 23:35:46 +00:00

27 lines
435 B
Ruby
Executable file

#!ruby -an
BEGIN {
require 'fileutils'
dir = ARGV.shift
ARGF.eof?
FileUtils.mkdir_p(dir)
Dir.chdir(dir)
}
n, v, u = $F
case n
when "minitest"
v = "master"
when "test-unit"
else
v = "v" + v
end
if File.directory?(n)
puts "updating #{n} ..."
system(*%W"git fetch", chdir: n) or abort
else
puts "retrieving #{n} ..."
system(*%W"git clone #{u} #{n}") or abort
end
system(*%W"git checkout #{v}", chdir: n) or abort