Sha256: cb17987a219e8bc312384a9afbc4941a76be0bbcc0f6b6801ac38f0db9836165

Contents?: true

Size: 688 Bytes

Versions: 6

Compression:

Stored size: 688 Bytes

Contents

#!/usr/bin/env ruby

require "bundler/inline"
gemfile do
  source "https://rubygems.org"
  gem "multi_repo", require: "multi_repo/cli", path: File.expand_path("..", __dir__)
end

opts = Optimist.options do
  synopsis "Run a command in each repo."

  opt :command, "A command to run in each repo", :type => :string, :required => true
  opt :ref, "Ref to checkout before running the command", :type => :string, :default => "master"

  MultiRepo::CLI.common_options(self, :except => :dry_run)
end

MultiRepo::CLI.each_repo(**opts) do |repo|
  repo.git.fetch
  repo.git.hard_checkout(opts[:ref])
  repo.chdir do
    puts "+ #{opts[:command]}".light_black
    system(opts[:command])
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
multi_repo-0.5.0 scripts/each_repo
multi_repo-0.4.0 scripts/each_repo
multi_repo-0.3.1 scripts/each_repo
multi_repo-0.3.0 scripts/each_repo
multi_repo-0.2.3 scripts/each_repo
multi_repo-0.2.2 scripts/each_repo