-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix-up CHANGELOG.md line endings #595
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,6 +83,19 @@ begin | |
metadata = JSON.load(File.read(metadata_json)) | ||
config.project = metadata['name'] | ||
end | ||
|
||
# Workaround for https://github.com/github-changelog-generator/github-changelog-generator/issues/715 | ||
require 'rbconfig' | ||
if RbConfig::CONFIG['host_os'] =~ /linux/ | ||
task :changelog do | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will this extend the current There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
puts 'Fixing line endings...' | ||
changelog_file = File.join(__dir__, 'CHANGELOG.md') | ||
changelog_txt = File.read(changelog_file) | ||
new_contents = changelog_txt.gsub(%r{\r\n}, "\n") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the same gsub as the stdlib function. |
||
File.open(changelog_file, "w") {|file| file.puts new_contents } | ||
end | ||
end | ||
|
||
rescue LoadError | ||
end | ||
# vim: syntax=ruby |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at this:
Blacksmith::Modulefile.new
should also provide this info and there's no need to load the metadata.json file again.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess you were looking at this because it also uses
File.dirname(__FILE__)
? Since there might be a better solution, I've not updated here too.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's fine. I was looking at the task definition because Foreman does it that way.