From 1357b3980de244818ddaaf63f87fe2b6ccf1e9ec Mon Sep 17 00:00:00 2001 From: Petr Korolev Date: Tue, 11 Nov 2014 18:01:28 +0200 Subject: [PATCH] Fix bug with auto-detect project name, when there is dot signs in project name add fix for username also --- lib/github_changelog_generator/parser.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/github_changelog_generator/parser.rb b/lib/github_changelog_generator/parser.rb index 61a4c0a..b24889b 100644 --- a/lib/github_changelog_generator/parser.rb +++ b/lib/github_changelog_generator/parser.rb @@ -56,9 +56,9 @@ class Parser if !options[:user] && !options[:project] remote = `git remote -vv`.split("\n") - match = /.*(?:[:\/])(\w*)\/((?:-|\w)*)\.git.*/.match(remote[0]) + match = /.*(?:[:\/])((?:-|\w|\.)*)\/((?:-|\w|\.)*)\.git.*/.match(remote[0]) - if match[1] && match[2] + if match && match[1] && match[2] puts "Detected user:#{match[1]}, project:#{match[2]}" options[:user], options[:project] = match[1], match[2] end