Remove all old credit lines in the output then add a new one (#526)

* Fixes #507 - Removes old credit lines in log so that there are no duplicates

* Added missing newline at end of file

* Replaced single-quoted empty string with double quotes
This commit is contained in:
Olle Jonsson 2017-09-10 11:56:11 +02:00 committed by GitHub
commit b94fb7f839

View File

@ -21,8 +21,10 @@ module GitHubChangelogGenerator
log += File.read(options[:base]) if File.file?(options[:base])
credit_line = "\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*"
log += "\n\n#{credit_line}" unless log.include?(credit_line)
credit_line = "\n\n\\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*"
log.gsub!(credit_line, "") # Remove old credit lines
log += credit_line
@log = log
end