added detection of repository name from url

This commit is contained in:
brb
2023-07-05 20:42:45 +02:00
parent 99d84ae61a
commit ebb091fb6c
+7 -2
View File
@@ -1,4 +1,9 @@
from pydantic import AnyHttpUrl from pydantic import AnyHttpUrl
from pathlib import Path
def clone_repository(repo_url: AnyHttpUrl): def clone_repository(repo_url: AnyHttpUrl) -> Path:
print(f'cloning into {repo_url}') print(f'cloning into {repo_url}')
repo_name = repo_url.split('/')[-1].strip('.git')
dst_dir = Path(__file__).parent / repo_name
dst_dir.mkdir()
return dst_dir