Sha256: 3662027591a1b44bddc12c8fee26682c17a9d27e7bc8fc2544991d32b8f04fcc

Contents?: true

Size: 684 Bytes

Versions: 27

Compression:

Stored size: 684 Bytes

Contents

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

module GGSM
  module Foreach
    include Submodule
    include Stash

    def foreach_flow(*commands)
      check_submodule

      cmd = ''
      if commands.size == 0
        puts '请输入正确git命令 foreach [<commands>...]'.red
        return
      elsif commands.fetch(0) == 'git'
        commands.delete_at(0)
      end

      commands.each do |arg|
        cmd = "#{cmd} #{arg}"
      end

      foreach_module {
        system "git #{cmd}"
      }

      puts '==> *进入主工程:'.yellow
      system "git #{cmd}"

      puts "Modules执行:git#{cmd}".blue
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

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