Module: Beet::SCM

Included in:
Executor
Defined in:
lib/beet/scm.rb

Instance Method Summary collapse

Instance Method Details

#git(command = {}) ⇒ Object

Run a command in git.

Examples

git :init
git :add => "this.file that.rb"
git :add => "onefile.rb", :rm => "badfile.cxx"


22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/beet/scm.rb', line 22

def git(command = {})
  in_root do
    if command.is_a?(Symbol)
      log 'running', "git #{command}"
      Git.run(command.to_s)
    else
      command.each do |command, options|
        log 'running', "git #{command} #{options}"
        Git.run("#{command} #{options}")
      end
    end
  end
end