Sha256: 660d62504e4ab388c6d55b7333d600b79b08a04508f5c0bc10ab650d804e9135

Contents?: true

Size: 807 Bytes

Versions: 31

Compression:

Stored size: 807 Bytes

Contents

module Braid
  module Commands
    class Remove < Command
      def run(path, options = {})
        mirror = config.get!(path)

        with_reset_on_error do
          msg "Removing mirror from '#{mirror.path}'."

          git.rm_r(mirror.path)

          config.remove(mirror)
          add_config_file

          if options[:keep]
            msg "Not removing remote '#{mirror.remote}'" if verbose?
          elsif git.remote_url(mirror.remote)
            msg "Removed remote '#{mirror.path}'" if verbose?
            git.remote_rm mirror.remote
          else
            msg "Remote '#{mirror.remote}' not found, nothing to cleanup" if verbose?
          end

          git.commit("Remove mirror '#{mirror.path}'")
          msg 'Removed mirror.' if verbose?
        end
      end
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
braid-1.1.7 lib/braid/commands/remove.rb
braid-1.1.6 lib/braid/commands/remove.rb
braid-1.1.5 lib/braid/commands/remove.rb
braid-1.1.4 lib/braid/commands/remove.rb
braid-1.1.3 lib/braid/commands/remove.rb
braid-1.1.2 lib/braid/commands/remove.rb
braid-1.1.1 lib/braid/commands/remove.rb
braid-1.1.0 lib/braid/commands/remove.rb
braid-1.0.22 lib/braid/commands/remove.rb
braid-1.0.21 lib/braid/commands/remove.rb
braid-1.0.20 lib/braid/commands/remove.rb
braid-1.0.19 lib/braid/commands/remove.rb
braid-1.0.18 lib/braid/commands/remove.rb
braid-1.0.17 lib/braid/commands/remove.rb
braid-1.0.16 lib/braid/commands/remove.rb
braid-1.0.15 lib/braid/commands/remove.rb
braid-1.0.14 lib/braid/commands/remove.rb
braid-1.0.13 lib/braid/commands/remove.rb
braid-1.0.12 lib/braid/commands/remove.rb
braid-1.0.11 lib/braid/commands/remove.rb