X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;ds=sidebyside;f=Rakefile;h=c45dfc8c07e5a74f8fe4536a32a0f503d7084b21;hb=2037bb0097373b3d29a931c553743419f82be3ab;hp=13b58c86ddcc8d51fff1e19c957deab7f9565fd6;hpb=f9887deca4a8d83daf5caa8c35b4999b84194338;p=puppet-modules%2Fpuppetlabs-apt.git diff --git a/Rakefile b/Rakefile index 13b58c8..c45dfc8 100644 --- a/Rakefile +++ b/Rakefile @@ -16,8 +16,17 @@ end def changelog_project return unless Rake.application.top_level_tasks.include? "changelog" - returnVal = nil || JSON.load(File.read('metadata.json'))['source'].match(%r{.*/([^/]*)})[1] - raise "unable to find the changelog_project in .sync.yml or the name in metadata.json" if returnVal.nil? + + returnVal = nil + returnVal ||= begin + metadata_source = JSON.load(File.read('metadata.json'))['source'] + metadata_source_match = metadata_source && metadata_source.match(%r{.*\/([^\/]*?)(?:\.git)?\Z}) + + metadata_source_match && metadata_source_match[1] + end + + raise "unable to find the changelog_project in .sync.yml or calculate it from the source in metadata.json" if returnVal.nil? + puts "GitHubChangelogGenerator project:#{returnVal}" returnVal end