Sha256: 8d98c06a0fd7d88af97bf9c2f11f9c77224c3aeb9072ae43b5e1d6fcf55a06fa

Contents?: true

Size: 653 Bytes

Versions: 5

Compression:

Stored size: 653 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 :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.2.1 scripts/destroy_remote
multi_repo-0.2.0 scripts/destroy_remote
multi_repo-0.1.2 scripts/destroy_remote
multi_repo-0.1.1 scripts/destroy_remote
multi_repo-0.1.0 scripts/destroy_remote