1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Try with and without "v" prefix for numeric tag

This commit is contained in:
Nobuyoshi Nakada 2020-02-24 12:40:34 +09:00
parent 116b9e6a16
commit f8401732de
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60

View file

@ -9,25 +9,16 @@ BEGIN {
}
n, v, u = $F
case n
when "test-unit"
else
v = "v" + v
end
if File.directory?(n)
puts "updating #{n} ..."
if v == "master"
system(*%W"git pull", chdir: n) or abort
else
system(*%W"git fetch", chdir: n) or abort
end
system("git", (v == "master" ? "pull" : "fetch"), chdir: n) or abort
else
puts "retrieving #{n} ..."
system(*%W"git clone #{u} #{n}") or abort
end
unless system(*%W"git checkout #{v}", chdir: n)
unless v.sub!(/\Av/, '') and system(*%W"git checkout #{v}", chdir: n)
unless system(*%W"git checkout #{v.sub(/\A(?=\d)/, 'v')}", chdir: n)
unless /\A\d/ =~ v and system(*%W"git checkout #{v}", chdir: n)
abort
end
end