Class: Brigit::UpdateCommand
- Defined in:
- lib/brigit/commands/update_command.rb
Instance Attribute Summary
Attributes inherited from Command
Instance Method Summary collapse
Methods inherited from Command
Methods included from Pretending
Methods included from Fallible
Methods included from Listable
Constructor Details
This class inherits a constructor from Brigit::Command
Instance Method Details
#run ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/brigit/commands/update_command.rb', line 8 def run pull = false super do parser.on('-p', '--pull', "Pull master repo (if on branch `master')") do pull = true end end if pull if Brigit.repo.branch.name == 'master' sh "git pull origin master" else say "Not on `master' branch; skipping update of main repo..." end end Brigit.at_dot_gitmodules do |path| say "---\nSubmodule: #{path}" sh "git submodule init" sh "git submodule update" end end |