Class: Snippy::Git
- Inherits:
-
Thor
- Object
- Thor
- Snippy::Git
- Defined in:
- lib/snippy/git.rb
Instance Method Summary collapse
Instance Method Details
#retag ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/snippy/git.rb', line 9 def retag raise Thor::Error, "Not a git repository!" unless Dir.exists?(".git") g = ::Git.open(".") = g. raise Thor::Error, "No tag found!" if .empty? tag = .pop.name puts "Deleting tag: #{tag}" system "git tag -d #{tag}" puts "Creating tag: #{tag}" g.add_tag(tag) if [:push] raise Thor::Error, "No remote!" if g.branches.remote.empty? puts "Pushing files" g.push end end |