-
Notifications
You must be signed in to change notification settings - Fork 40
Open
Description
I noticed in _generate_path_from_repo_url we remove the colons from the netloc, however we don't try to remove colons anywhere else like from path, which makes something like
urlparse('git@git.dev.box.net:Productivity/ClusterRunnerHealthCheck.git')
# ParseResult(scheme='', netloc='', path='git@git.dev.box.net:Productivity/ClusterRunnerHealthCheck.git', params='', query='', fragment='')
create a repo directory like
~/.clusterrunner/repos/master/git@git.dev.box.net:Productivity/ClusterRunnerHealthCheck
Since Windows doesn't like colons in directory paths, we could just do all the illegal character removing at the end instead of trying to hit each piece as we create the path.
Something like:
@staticmethod
def _generate_path_from_repo_url(base_sys_path, url):
# ...
return Git._clean_path_url(os.path.join(repo_directory, repo_name))
@staticmethod
def _clean_path_url(url):
illegal_chars = [':', '-'] # any characters that we don't want in a directory path
clean_url = ''.join(c for c in url if c not in illegal_chars)
return clean_urlReactions are currently unavailable