Sha256: 0b9c13fae18de7da1fccd77ed62a0916cadf1db143e8a274f83d5a7e07dd5e0a

Contents?: true

Size: 807 Bytes

Versions: 8

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

8 entries across 8 versions & 1 rubygems

Version Path
realityforge-braid-0.9.9 lib/braid/commands/remove.rb
realityforge-braid-0.9.8 lib/braid/commands/remove.rb
realityforge-braid-0.9.7 lib/braid/commands/remove.rb
realityforge-braid-0.9.6 lib/braid/commands/remove.rb
realityforge-braid-0.9.5 lib/braid/commands/remove.rb
realityforge-braid-0.9.4 lib/braid/commands/remove.rb
realityforge-braid-0.9.3 lib/braid/commands/remove.rb
realityforge-braid-0.9.2 lib/braid/commands/remove.rb