Sha256: 8a04ceb306af37e2782c4175b3d3ad41636e5cbedca3174ec023119977d83ca6

Contents?: true

Size: 1.14 KB

Versions: 1

Compression:

Stored size: 1.14 KB

Contents

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
KCommercialPipeline-0.2.5.1 lib/KCommercialPipeline/command/command.rb