Skip to content

Commit

Permalink
Auto-restore docs
Browse files Browse the repository at this point in the history
  • Loading branch information
marcandre committed Sep 18, 2020
1 parent a1035a1 commit 571d1a1
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions tasks/cut_release.rake
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

require 'bump'

def update_file(path)
content = File.read(path)
File.write(path, yield(content))
end

namespace :cut_release do
%w[major minor patch pre].each do |release_type|
desc "Cut a new #{release_type} release, create release notes " \
Expand All @@ -15,11 +20,6 @@ namespace :cut_release do
version.split('.').take(2).join('.')
end

def update_file(path)
content = File.read(path)
File.write(path, yield(content))
end

def update_antora(version)
update_file('docs/antora.yml') do |yaml|
yaml.gsub(/version: .*/, "version: '#{version_sans_patch(version)}'")
Expand Down Expand Up @@ -49,3 +49,13 @@ namespace :cut_release do
puts "Changed version from #{old_version} to #{new_version}."
end
end

desc 'and restore docs/antora'
task :release do
udpate_file 'docs/antora.yml' do |s|
s.gsub!(/version: .*/, 'version: master')
end
cmd = "git commit -am 'Restore docs/antora.yml'"
puts cmd
system cmd
end

0 comments on commit 571d1a1

Please sign in to comment.