Class: Brigit::GrabCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/brigit/commands/grab_command.rb

Instance Attribute Summary

Attributes inherited from Command

#args

Instance Method Summary collapse

Methods inherited from Command

help, #initialize

Methods included from Pretending

#pretend!

Methods included from Fallible

#fail

Methods included from Listable

included

Constructor Details

This class inherits a constructor from Brigit::Command

Instance Method Details

#runObject



8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/brigit/commands/grab_command.rb', line 8

def run
  super { |parser| add_pretend_to parser }
  matching_repositories.each do |name, location|
    if File.exists?(name)
      say "#{name}: Already exists, skipping..."
    else
      say "#{name}: Cloning from #{location} ..."
      sh "git clone '#{location}' '#{name}'"
      say "#{name}: Updating submodules ..."
      update name
    end
  end
end