Remove software carpentries logo
[rnaseq-cwl-training.git] / bin / repo_check.py
old mode 100755 (executable)
new mode 100644 (file)
index af4b782..9bf5c59
@@ -1,5 +1,3 @@
-#!/usr/bin/env python3
-
 """
 Check repository settings.
 """
@@ -22,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}/'
@@ -104,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]