class DYAutomate::Command::Git::TagAdd

Public Class Methods

new(argv) click to toggle source

#要查询的lib名字 attr_accessor :name #查询结果lib信息 attr_accessor :info

Calls superclass method DYAutomate::Command::Git::new
# File lib/DYAutomate/Command/Git/tagAdd.rb, line 20
def initialize(argv)
  # @name = argv.shift_argument
  super
end

Public Instance Methods

add_tag(newTag) click to toggle source
# File lib/DYAutomate/Command/Git/tagAdd.rb, line 41
def add_tag(newTag)

  @git_obj.tags.each{|x|
    if x.name.eql?(newTag)
      puts "Errror git --- #{newTag} has exist!"
    end
  }

  #git操作
    begin
      git.add(:all=>true)
      #提交更改
      git.commit("修改版本号 newTag")
      git.push
      
      #打tag
      git.add_tag(newTag, {:m => "tag更新"})
      #push tag
      git.push('origin','master',{:tags =>newTag})
    rescue
      git.reset_hard()
      puts "Errror git --- newTag"
    end
end
run() click to toggle source
# File lib/DYAutomate/Command/Git/tagAdd.rb, line 36
def run
  pp('tagAdd run ...',1)

end
validate!() click to toggle source
Calls superclass method DYAutomate::Command::Git#validate!
# File lib/DYAutomate/Command/Git/tagAdd.rb, line 25
def validate!
  super
  # unless @name
  #   help! 'need the lib `NAME`.'
  # end

  # unless existAtPools?
  #   help! "the podspec file is not exist at #{Dir.pwd}."
  # end
end