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:
parent
116b9e6a16
commit
f8401732de
1 changed files with 3 additions and 12 deletions
|
@ -9,25 +9,16 @@ BEGIN {
|
||||||
}
|
}
|
||||||
|
|
||||||
n, v, u = $F
|
n, v, u = $F
|
||||||
case n
|
|
||||||
when "test-unit"
|
|
||||||
else
|
|
||||||
v = "v" + v
|
|
||||||
end
|
|
||||||
|
|
||||||
if File.directory?(n)
|
if File.directory?(n)
|
||||||
puts "updating #{n} ..."
|
puts "updating #{n} ..."
|
||||||
if v == "master"
|
system("git", (v == "master" ? "pull" : "fetch"), chdir: n) or abort
|
||||||
system(*%W"git pull", chdir: n) or abort
|
|
||||||
else
|
|
||||||
system(*%W"git fetch", chdir: n) or abort
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
puts "retrieving #{n} ..."
|
puts "retrieving #{n} ..."
|
||||||
system(*%W"git clone #{u} #{n}") or abort
|
system(*%W"git clone #{u} #{n}") or abort
|
||||||
end
|
end
|
||||||
unless system(*%W"git checkout #{v}", chdir: n)
|
unless system(*%W"git checkout #{v.sub(/\A(?=\d)/, 'v')}", chdir: n)
|
||||||
unless v.sub!(/\Av/, '') and system(*%W"git checkout #{v}", chdir: n)
|
unless /\A\d/ =~ v and system(*%W"git checkout #{v}", chdir: n)
|
||||||
abort
|
abort
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue