require 'claide' require 'KCommercialPipeline/version' require 'kwai/core' require 'KCommercialPipeline/core/git' require 'KCommercialPipeline/App' module KCommercial module KCPipeline class Command < CLAide::Command self.command = 'KCommercialPipeline' self.version = KCommercialPipeline::VERSION self .description = "KCommercial Pipeline command line tools" def self.options [ ['--app_id', "app name,matrix or i18n"] ].concat(super ) end 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 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 end end end