Method: Pod::Command::Tag::SpecPush#run

Defined in:
lib/cocoapods-tag/command/tag/spec_push.rb

#runObject


24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/cocoapods-tag/command/tag/spec_push.rb', line 24

def run
  require 'cocoapods-tag/native/validator'

  unless @repo
    raise Informative, "请输入spec repo"
  end
  unless @podspec
    raise Informative, "请输入要上传的podspec"
  end
  UI.title "推送`#{@podspec}`到`#{@repo}`仓库".yellow do
    argvs = [
      @repo,
      @podspec,
      '--allow-warnings'
    ]
    begin
      push = Pod::Command::Repo::Push.new(CLAide::ARGV.new(argvs))
      push.validate!
      push.run
    rescue Pod::StandardError => e
      @error = e
      print "推送`#{@podspec}`到`#{@repo}`仓库失败!#{e}".red
    end
  end
end