Class: Braid::Commands::Remove

Inherits:
Braid::Command show all
Defined in:
lib/braid/commands/remove.rb

Instance Method Summary collapse

Methods inherited from Braid::Command

#config, msg, #msg, run

Methods included from Operations::VersionControl

#git, #git_cache, #git_svn, #svn

Instance Method Details

#run(path) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/braid/commands/remove.rb', line 4

def run(path)
  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

    commit_message = "Remove mirror '#{mirror.path}/'"
    git.commit(commit_message)
  end
end