From 2cc15f7be0ccd4a721dccefc419dfe20a7079c38 Mon Sep 17 00:00:00 2001 From: Enether Date: Sat, 3 Jun 2017 18:22:23 +0300 Subject: [PATCH] Fixes #507 - Removes old credit lines in log so that there are no duplicates --- .../generator/generator_generation.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/github_changelog_generator/generator/generator_generation.rb b/lib/github_changelog_generator/generator/generator_generation.rb index a86bf89..abfc940 100644 --- a/lib/github_changelog_generator/generator/generator_generation.rb +++ b/lib/github_changelog_generator/generator/generator_generation.rb @@ -21,7 +21,10 @@ module GitHubChangelogGenerator log += File.read(options[:base]) if File.file?(options[:base]) - log += "\n\n\\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*" + 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 @@ -175,4 +178,4 @@ module GitHubChangelogGenerator end end end -end +end \ No newline at end of file