Sha256: 2e2dd16b56ba232ecb37229f7ce52fcb4aeb4d30cc5f984e7ec9bfa579d2770d

Contents?: true

Size: 708 Bytes

Versions: 5

Compression:

Stored size: 708 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 "Destroy a remote on all local git repos."

  opt :remote, "The remote to destroy", :type => :string, :required => true

  MultiRepo::CLI.common_options(self)
end

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

  if opts[:dry_run]
    puts "** dry-run: git remote rm #{opts[:remote]}".light_black
  else
    repo.git.client.remote("rm", opts[:remote])
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
multi_repo-0.4.0 scripts/destroy_remote
multi_repo-0.3.1 scripts/destroy_remote
multi_repo-0.3.0 scripts/destroy_remote
multi_repo-0.2.3 scripts/destroy_remote
multi_repo-0.2.2 scripts/destroy_remote