Sha256: 7c28a37c19697dda9a4fbd7b4d6c8a042d99949875e8cb0ac91ec2edd11f61ed

Contents?: true

Size: 1.54 KB

Versions: 2

Compression:

Stored size: 1.54 KB

Contents

require 'thor'
require_relative 'ggsm/version'
require_relative 'ggsm/flow/start'
require_relative 'ggsm/flow/sync'
require_relative 'ggsm/flow/switch'
require_relative 'ggsm/flow/delete'
require_relative 'ggsm/flow/foreach'
require_relative 'ggsm/flow/merge'
require_relative 'ggsm/flow/finish'

module GGSM
  class Cli < Thor
    include Start
    include Sync
    include Switch
    include Delete
    include Foreach
    include Merge
    include Finish

    desc 'start <branch> [<commit>] [<origin>]', '检出新分支,新功能、修bug务必使用该命令'
    def start(branch, action='')
      start_flow(branch, action)
    end

    desc 'switch <branch>', '切换分支'
    def switch(branch)
      switch_flow(branch)
    end

    desc 'sync', '当前分支同步(拉取)远程代码'
    def sync
      sync_flow
    end

    desc 'delete <branch> [-r|--remote] [-a|--all]', '删除指定分支'
    option :remote, :default => false, :type => :boolean, aliases: '-r'
    option :all, :default => false, :type => :boolean, aliases: '-a'
    def delete(branch)
      remote = options[:remote]
      all = options[:all]
      delete_flow(branch, remote, all)
    end

    desc 'foreach [<commands>...]', '所有模块执行git命令(foreach后跟git命令)'
    def foreach(*commands)
      foreach_flow(*commands)
    end

    desc 'merge [<branch>]', 'Merge,开发完成后执行'
    def merge(branch='origin/dev')
      merge_flow(branch)
    end

    desc 'finish', 'Merge后并解决冲突后执行'
    def finish
      finish_flow
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ggsm-1.4.0 lib/ggsm.rb
ggsm-1.3.0 lib/ggsm.rb