Sha256: 9398b0c6a17d8c6280e89b2fbec2eea9b348cc09d85d29a808b6f0bede4f53d2

Contents?: true

Size: 611 Bytes

Versions: 5

Compression:

Stored size: 611 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
  opt :branch, "The branch to destroy.", :type => :string, :required => true

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

MultiRepo::CLI.each_repo(**opts) do |repo|
  unless repo.git.branch?(opts[:branch])
    puts "!! Skipping because #{opts[:branch]} branch doesn't exist".yellow
    next
  end

  repo.git.client.checkout("master")
  repo.git.client.branch("-D", opts[:branch])
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
multi_repo-0.2.1 scripts/destroy_branch
multi_repo-0.2.0 scripts/destroy_branch
multi_repo-0.1.2 scripts/destroy_branch
multi_repo-0.1.1 scripts/destroy_branch
multi_repo-0.1.0 scripts/destroy_branch