Skip to content

Commit

Permalink
Rakefile: changelog task: ensure correct line endings
Browse files Browse the repository at this point in the history
  • Loading branch information
bastelfreak committed Jun 28, 2024
1 parent 41a9d6c commit 8684758
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,18 @@ else
gem_version = Gem::Specification.load("#{config.project}.gemspec").version
config.future_release = gem_version
end

# Workaround for https://github.com/github-changelog-generator/github-changelog-generator/issues/715
require 'rbconfig'
if RbConfig::CONFIG['host_os'].include?('linux')
task :changelog do
puts 'Fixing line endings...'
changelog_file = File.join(__dir__, 'CHANGELOG.md')
changelog_txt = File.read(changelog_file)
new_contents = changelog_txt.gsub("\r\n", "\n")
File.open(changelog_file, 'w') { |file| file.puts new_contents }
end
end
end

begin
Expand Down

0 comments on commit 8684758

Please sign in to comment.