зеркало из https://github.com/github/ruby.git
Try with and without "v" prefix for numeric tag
This commit is contained in:
Родитель
116b9e6a16
Коммит
f8401732de
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче