Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/usr/bin/env ruby
tagname = ARGV.pop
def prompt(*args)
print(*args)
gets.chomp
end
if tagname.nil?
STDOUT.puts "No tag given, usage: git_tag.rb tagname"
exit 1
else
cmd = system("git tag -a #{tagname} -m 'Tagging for release: #{tagname}'")
if cmd
answer = prompt("Tag '#{tagname}' created! Do you want to push it to origin? (y/n)")
if answer == 'y'
system("git push origin #{tagname}")
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.