Skip to content

Commit

Permalink
add revision line to all README files during release
Browse files Browse the repository at this point in the history
  • Loading branch information
mojavelinux committed May 18, 2023
1 parent 8242797 commit 6827956
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tasks/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@
readme_contents = (File.readlines readme_file, mode: 'r:UTF-8').map do |l|
(l.start_with? ':release-version: ') ? %(:release-version: #{release_version}\n) : l
end
if readme_contents[2].start_with? 'v'
readme_contents[2] = %(v#{release_version}, #{release_date}\n)
elsif readme_file == 'README.adoc'
readme_contents.insert 2, %(v#{release_version}, #{release_date}\n)
if readme_file.include? 'README'
if readme_contents[2].start_with? 'v'
readme_contents[2] = %(v#{release_version}, #{release_date}\n)
else
readme_contents.insert 2, %(v#{release_version}, #{release_date}\n)
end
end
[readme_file, readme_contents]
end
Expand Down

0 comments on commit 6827956

Please sign in to comment.