Class: YJCocoa::GitTagDelete

Inherits:
GitTag show all
Defined in:
lib/yjcocoa/git/git_tag_delete.rb

Overview

Usage

Constant Summary

Constants inherited from Command

Command::DEFAULT_OPTIONS

Instance Attribute Summary

Attributes inherited from GitTag

#addTag, #deleteTags

Instance Method Summary collapse

Methods inherited from GitTag

#gitTagAdd, #gitTagDelete, #initialize, options, #validate!

Methods inherited from Git

#gitExist?

Methods inherited from Command

#askWithAnswers, options

Constructor Details

This class inherits a constructor from YJCocoa::GitTag

Instance Method Details

#runObject



22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/yjcocoa/git/git_tag_delete.rb', line 22

def run
    tag = `git tag`.split("\n").last
    if tag
        answer = self.askWithAnswers("是否删除 tag #{tag}", ["Yes", "No"])
        if answer == "yes"
            system("YJCocoa git tag --delete=#{tag}")
        end
        else
        puts "暂无 Tag".green
        self.banner!
    end
end