Skip to content

Commit

Permalink
Try with and without "v" prefix for numeric tag
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu committed Feb 24, 2020
1 parent 116b9e6 commit f840173
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions tool/fetch-bundled_gems.rb
Expand Up @@ -9,25 +9,16 @@
}

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

0 comments on commit f840173

Please sign in to comment.