#!/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 repo.git.destroy_remote(opts[:remote]) end