-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathRakefile
More file actions
24 lines (19 loc) · 719 Bytes
/
Rakefile
File metadata and controls
24 lines (19 loc) · 719 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
desc "create a new release"
task 'release' do
current_version = run('git tag').split(/\n/).last.strip[1..-1]
puts "What version do you want to release? (current: #{current_version})"
version = STDIN.gets.strip
version_tag = "v%s" % version
if run('git tag').split(/\n/).include?(version_tag)
raise("This tag has already been committed to the repo.")
end
rbenv_contents = File.read('rbenv.el')
File.write('rbenv.el', rbenv_contents.gsub("Version: #{current_version}", "Version: #{version}"))
run "git commit -a -m \"prepare #{version}\""
run "git tag -a -m \"Version #{version}\" #{version_tag}"
run "git push origin"
run "git push origin --tags"
end
def run(command)
`#{command}`
end