Fixing repository name extraction

This commit is contained in:
José Manuel Barroso Galindo
2022-12-17 17:20:52 +01:00
committed by GitHub
parent ed99af40a6
commit 9f2890c2de

View File

@@ -607,7 +607,7 @@ def collect_cheat_zips(url):
return [f[f.find('mister_'):f.find('.zip') + 4] for f in text.splitlines() if 'mister_' in f and '.zip' in f]
def download_mister_devel_repository(input_url, delme, category):
name = input_url.rsplit('/', 1)[-1]
name = get_repository_name(input_url)
name, branch = get_branch(name)
path = f'{delme}/{name}'
@@ -622,6 +622,9 @@ def download_mister_devel_repository(input_url, delme, category):
download_repository(path, git_url, branch)
return path
def get_repository_name(input_url):
return str(Path(urlparse(input_url).path.split('/')[2]).with_suffix(''))
# file system utilities
def get_branch(name):