Class: Bytedance::BytedanceManager::Lib::Publish

Inherits:
Bytedance::BytedanceManager::Lib show all
Defined in:
lib/command/lib/publish.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ Publish

Returns a new instance of Publish.



17
18
19
20
21
22
23
# File 'lib/command/lib/publish.rb', line 17

def initialize(params)
  super
  @fastlane_helper = FastlaneHelper.new
  @target_repo    = params.option('repo','optional')
  @target_project = params.option('project')
  @target_version = params.option('pod-version')
end

Class Method Details

.optionsObject



11
12
13
14
15
# File 'lib/command/lib/publish.rb', line 11

def self.options
  [['--project', '是否引入平台基础库,默认引入,不引入使用--no-platform'],
  ['--repo', 'none 不引入任何组件,optional 选择自己想要的(default), all 引入全部组件,于平台一致'],
  ['--pod-version', '可选,默认 prefix = TT']].concat(super)
end

Instance Method Details

#runObject



36
37
38
39
40
# File 'lib/command/lib/publish.rb', line 36

def run
  super
  puts "Publish running"
  @fastlane_helper.execute_fastlane_action('git_pull')
end

#validate!Object



25
26
27
28
29
30
31
32
33
34
# File 'lib/command/lib/publish.rb', line 25

def validate!
  super
  if @components && !%w(none optional all).include?(@components)
  help! "`#{@components}' 参数无效,components = none 或 optional 或 all "          
end

if !@target_project
  help! "参数错误,需要输入项目名称,bytedance lib create projectName"
end
end