Module: GGSM::Finish

Includes:
Submodule
Included in:
Cli
Defined in:
lib/ggsm/command/finish.rb

Instance Method Summary collapse

Methods included from Submodule

#check_submodule, #check_submodule_status, #check_un_commit_code, #correct_dir, #foreach_module, #get_current_branch, #get_modified_submodule, #get_submodule, #get_submodule_commit, #tip_contact_author

Methods included from Hooks

#check_hooks, #cp_files, #cp_hooks, #update_hooks

Instance Method Details

#finish_flowObject



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/ggsm/command/finish.rb', line 8

def finish_flow
  check_submodule

  foreach_module {
    process_finish
  }

  puts '==> 进入主工程:'.yellow
  process_finish

  puts 'Modules执行:git add & commit & push'.blue
end

#process_finishObject



21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/ggsm/command/finish.rb', line 21

def process_finish
  system 'git add .'

  branch = get_current_branch
  if branch.include?('rebas')
    system 'git rebase --continue'
  else
    system 'git commit'
  end

  system "git push origin #{get_current_branch}"
end