-
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
Fix-up CHANGELOG.md line endings #595
Conversation
puts 'Fixing line endings...' | ||
changelog_file = File.join(File.dirname(__FILE__), '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 comment
The reason will be displayed to describe this comment to others. Learn more.
This is the same gsub as the stdlib function.
Oh, in Foreman we hook into it by adding an extension: |
@@ -83,6 +83,19 @@ begin | |||
metadata = JSON.load(File.read(metadata_json)) | |||
config.project = metadata['name'] |
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.
On Linux, workaround github-changelog-generator/github-changelog-generator#715 by appending to `changelog` task with code that performs the equivalent of a `dos2unix`.
e3dc7f2
to
7ed49c9
Compare
# 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 comment
The reason will be displayed to describe this comment to others. Learn more.
Will this extend the current changelog
task or overwrite it?
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.
On Linux, workaround
github-changelog-generator/github-changelog-generator#715
by appending to
changelog
task with code that performs the equivalentof a
dos2unix
.