Class: KCommercial::KCPipeline::Command

Inherits:
CLAide::Command
  • Object
show all
Defined in:
lib/KCommercialPipeline/command/command.rb,
lib/KCommercialPipeline/command/rb_auto.rb,
lib/KCommercialPipeline/command/resource.rb,
lib/KCommercialPipeline/command/app_runner.rb,
lib/KCommercialPipeline/command/change_log.rb,
lib/KCommercialPipeline/command/feat_check.rb,
lib/KCommercialPipeline/command/check_release_cmd.rb,
lib/KCommercialPipeline/command/auto_cherry_pick_cmd.rb,
lib/KCommercialPipeline/command/git_hook_install_cmd.rb,
lib/KCommercialPipeline/command/ios_publish_component.rb

Defined Under Namespace

Classes: AppDemo, AutoCherryPickCommand, AutoReleaseCMD, ChangeLog, CheckReleaseCMD, CommentPublisher, FeatCheck, GitHookInstall, ResourceGenerator

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ Command

Returns a new instance of Command.



31
32
33
34
35
36
37
38
39
40
41
# File 'lib/KCommercialPipeline/command/command.rb', line 31

def initialize(argv)
  super
  app_id = argv.option('app_id')

  if app_id =="KCommercial"
    app_id = "matrix"
  elsif app_id =="Oversea"
    app_id = "i18n"
  end
  Application.instance.app_id = app_id || 'matrix'
end

Class Method Details

.optionsObject



13
14
15
16
17
# File 'lib/KCommercialPipeline/command/command.rb', line 13

def self.options
  [
    ['--app_id', "app name,matrix or i18n"]
  ].concat(super )
end

Instance Method Details

#runObject



12
13
14
# File 'lib/KCommercialPipeline/command/auto_cherry_pick_cmd.rb', line 12

def run
  AutoCherryPick.new().run
end

#validate!Object



19
20
21
22
23
24
25
26
27
28
29
# File 'lib/KCommercialPipeline/command/command.rb', line 19

def validate!
  super
  KCommercial::UI.shared_prefix = "KCPipelineLog"
  unless KCGit::git
    KCommercial::UI.error "当且项目未使用git托管,无法使用该功能"
    exit! 1
  end
  return unless @verbose
  KCommercial::UI.log_level = :verbose
  KCommercial::UI.show_time = true
end