Skip to content
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

Merged

Conversation

alexjfisher
Copy link
Member

On Linux, workaround
github-changelog-generator/github-changelog-generator#715
by appending to changelog task with code that performs the equivalent
of a dos2unix.

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")
Copy link
Member Author

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.

moduleroot/Rakefile.erb Outdated Show resolved Hide resolved
@ekohl
Copy link
Member

ekohl commented Oct 7, 2019

@@ -83,6 +83,19 @@ begin
metadata = JSON.load(File.read(metadata_json))
config.project = metadata['name']
Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member

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`.
@alexjfisher alexjfisher force-pushed the workaround_changelog_issue branch from e3dc7f2 to 7ed49c9 Compare October 7, 2019 16:35
# Workaround for https://github.com/github-changelog-generator/github-changelog-generator/issues/715
require 'rbconfig'
if RbConfig::CONFIG['host_os'] =~ /linux/
task :changelog do
Copy link
Member

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bastelfreak bastelfreak merged commit bb679ed into voxpupuli:master Oct 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants