Remove software carpentries logo
[rnaseq-cwl-training.git] / bin / repo_check.py
index 51d2fe0f1d950869dae38ccf1727692a8f8aac2c..9bf5c597cf1e328658cd99546fb205f61cc5552c 100644 (file)
@@ -20,7 +20,7 @@ except ImportError:
 
 
 # Pattern to match Git command-line output for remotes => (user name, project name).
-P_GIT_REMOTE = re.compile(r'upstream\s+[^:]+:([^/]+)/([^.]+)\.git\s+\(fetch\)')
+P_GIT_REMOTE = re.compile(r'upstream\s+(?:https://|git@)github.com[:/]([^/]+)/([^.]+)(\.git)?\s+\(fetch\)')
 
 # Repository URL format string.
 F_REPO_URL = 'https://github.com/{0}/{1}/'
@@ -102,7 +102,7 @@ def get_repo_url(repo_url):
     # Guess.
     cmd = 'git remote -v'
     p = Popen(cmd, shell=True, stdin=PIPE, stdout=PIPE,
-              close_fds=True, universal_newlines=True)
+              close_fds=True, universal_newlines=True, encoding='utf-8')
     stdout_data, stderr_data = p.communicate()
     stdout_data = stdout_data.split('\n')
     matches = [P_GIT_REMOTE.match(line) for line in stdout_data]