#!/usr/bin/env ruby require 'optparse' require_relative 'run' PROGNAME = 'vendor-gitaly-proto' USAGE = "Usage: #{PROGNAME} [--fork GITALY_PROTO_FORK_REPO] REVISION" ORIGIN = 'gitlab.com/gitlab-org/gitaly-proto' def main(revision, repo:) run!(%W[_support/migrate-proto #{repo} #{revision}]) run!(%w[make proto]) end options = ARGV.getopts(nil, 'fork:') abort USAGE unless ARGV.count == 1 main(ARGV.first, repo: options['fork'] || ORIGIN)