Skip to content

Commit bc362d9

Browse files
committed
Rakefile: changelog task: ensure correct line endings
1 parent e613291 commit bc362d9

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Rakefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,18 @@ else
6060
gem_version = Gem::Specification.load("#{config.project}.gemspec").version
6161
config.future_release = gem_version
6262
end
63+
64+
# Workaround for https://github.com/github-changelog-generator/github-changelog-generator/issues/715
65+
require 'rbconfig'
66+
if RbConfig::CONFIG['host_os'].include?('linux')
67+
task :changelog do
68+
puts 'Fixing line endings...'
69+
changelog_file = File.join(__dir__, 'CHANGELOG.md')
70+
changelog_txt = File.read(changelog_file)
71+
new_contents = changelog_txt.gsub("\r\n", "\n")
72+
File.open(changelog_file, 'w') { |file| file.puts new_contents }
73+
end
74+
end
6375
end
6476

6577
begin

0 commit comments

Comments
 (0)