Skip to content

Commit

Permalink
add tagit.rb to force tag
Browse files Browse the repository at this point in the history
  • Loading branch information
muquit committed Feb 11, 2019
1 parent bf08e7a commit 7e0901f
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions scripts/tagit.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/usr/bin/env ruby

# muquit@muquit.com Jan-20-2019
# force tag

require "highline/import"

def check_input(input)
if input.length == 0
puts "Nothing pecified. exiting.."
exit 1
end
end

begin
o = `git tag|sort`.chomp
tags = o.split("\n")
tags.each do |tag|
puts "#{tag}"
end

last_tag = `git describe --abbrev=0 --tags`
puts ""
puts "Last Tag: #{last_tag}"
puts ""

tag = ask "Enter Tag: "
check_input(tag)
puts "Tag: #{tag}"

comment = "Release #{tag}"
puts "Comment: #{comment}"

cmd = "git tag -f -a #{tag} -m \"#{comment}\""
puts "> #{cmd}"

ans = ask "Presss Enter to continue: "
if ans.length > 0
puts "Exit..."
exit 1
end

system(cmd)
cmd = "git push origin #{tag}"
puts "> #{cmd}"
system(cmd)


rescue => e
puts "ERROR: #{e}"
end

0 comments on commit 7e0901f

Please sign in to comment.