Class: Gct::Command::Repo::Push

Inherits:
Gct::Command::Repo show all
Defined in:
lib/gct/command/repo/push.rb

Instance Method Summary collapse

Methods inherited from Gct::Command

#auto_add_tag, #check_branch_can_be_update, #config_gitlab, #current_branch, #file_contents, #get_project, #gitlab_error, options, run

Constructor Details

#initialize(argv) ⇒ Push

Returns a new instance of Push.



15
16
17
18
# File 'lib/gct/command/repo/push.rb', line 15

def initialize(argv)
  @pod_name = argv.shift_argument
  super
end

Instance Method Details

#pushRepoObject



28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/gct/command/repo/push.rb', line 28

def pushRepo
  db = Database::Data.new
  sql = "select * from modular_headers where pod_name = '#{@pod_name}'"
  res = db.query(sql)
  modular_code = "--use-modular-headers" 
  if !res.nil? && res.count > 0
    modular_code = ""
  end
  command_code = "pod repo push iOSCRGTPodSource --sources=#{Constant.GitURL}iOSCRGTPodSource.git --verbose --skip-import-validation --use-libraries --allow-warnings #{modular_code}"

  puts "pod 命令为:#{command_code}".green
  # exception: ruby 2.6 以上生效
  system "#{command_code}", exception: true
end

#runObject



24
25
26
# File 'lib/gct/command/repo/push.rb', line 24

def run
  pushRepo
end

#validate!Object



20
21
22
# File 'lib/gct/command/repo/push.rb', line 20

def validate!
  super
end