Sha256: 4a524aa10f69430c65d7b1cd3488fcf366cb9ec5eea3ecf716eb31951ee5f729

Contents?: true

Size: 839 Bytes

Versions: 10

Compression:

Stored size: 839 Bytes

Contents

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

        bail_on_local_changes!

        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

10 entries across 10 versions & 3 rubygems

Version Path
realityforge-braid-0.9.1 lib/braid/commands/remove.rb
realityforge-braid-0.9.0 lib/braid/commands/remove.rb
realityforge-braid-0.8.0 lib/braid/commands/remove.rb
realityforge-braid-0.7.2 lib/braid/commands/remove.rb
braid-0.7.1 lib/braid/commands/remove.rb
braid-0.7.0 lib/braid/commands/remove.rb
braid-0.6.2 lib/braid/commands/remove.rb
honkster-braid-0.6.2 lib/braid/commands/remove.rb
braid-0.6.1 lib/braid/commands/remove.rb
braid-0.6 lib/braid/commands/remove.rb