Sha256: 476c62224e2217bf3293a8a12ecd093f47ad6e784e3565bcc1acd7a512ab73b0

Contents?: true

Size: 853 Bytes

Versions: 18

Compression:

Stored size: 853 Bytes

Contents

require 'colorize'
require_relative '../util/submodule'

module GGSM
  module Finish
    include Submodule

    def finish_flow(force)
      check_submodule

      foreach_module {
        process_finish(false)
      }

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

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

    def process_finish(force)
      system 'git add .'

      branch = get_current_branch
      if branch.include?('rebas')
        system 'git rebase --continue'
      else
        stage = `git diff --cached --name-only`.strip
        if stage == ''
          `git commit`
        else
          result = system 'git commit'
          unless result
            exit 1
          end
        end
      end

      `git push -u origin #{get_current_branch} #{force ? '-f' : ''}`
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
ggsm-1.9.5 lib/ggsm/command/finish.rb
ggsm-1.9.4 lib/ggsm/command/finish.rb
ggsm-1.9.3 lib/ggsm/command/finish.rb
ggsm-1.9.2 lib/ggsm/command/finish.rb
ggsm-1.9.1 lib/ggsm/command/finish.rb
ggsm-1.9.0 lib/ggsm/command/finish.rb
ggsm-1.8.6 lib/ggsm/command/finish.rb
ggsm-1.8.5 lib/ggsm/command/finish.rb
ggsm-1.8.4 lib/ggsm/command/finish.rb
ggsm-1.8.3 lib/ggsm/command/finish.rb
ggsm-1.8.2 lib/ggsm/command/finish.rb
ggsm-1.8.1 lib/ggsm/command/finish.rb
ggsm-1.8.0 lib/ggsm/command/finish.rb
ggsm-1.7.6 lib/ggsm/command/finish.rb
ggsm-1.7.5 lib/ggsm/command/finish.rb
ggsm-1.7.4 lib/ggsm/command/finish.rb
ggsm-1.7.3 lib/ggsm/command/finish.rb
ggsm-1.7.2 lib/ggsm/command/finish.rb