Sha256: 587d499101b2224b1548400e892898e54be37e82846d07718bb000b4eb14d5d0

Contents?: true

Size: 639 Bytes

Versions: 3

Compression:

Stored size: 639 Bytes

Contents

module Braid
  module Commands
    class Remove < Command
      def run(mirror)
        raise Braid::Git::LocalChangesPresent if invoke(:local_changes?)

        in_work_branch do
          params = config.get(mirror)
          unless params
            msg "Mirror '#{mirror}/' does not exist."
            return
          end

          msg "Removing #{params["type"]} mirror from '#{mirror}/'."

          invoke(:git_rm_r, mirror)

          config.remove(mirror)
          add_config_file

          commit_message = "Remove mirror '#{mirror}/'."
          invoke(:git_commit, commit_message)
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
evilchelu-braid-0.3.8 lib/braid/commands/remove.rb
evilchelu-braid-0.4.0 lib/braid/commands/remove.rb
misaka-braid-0.4.0.1 lib/braid/commands/remove.rb