mirror of
https://github.com/dw-0/kiauh.git
synced 2025-12-25 08:43:36 +05:00
refactor: trim ".git" from repo name
Signed-off-by: Dominik Willner <th33xitus@gmail.com>
This commit is contained in:
@@ -76,8 +76,9 @@ def get_repo_name(repo: Path) -> str | None:
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
cmd = ["git", "-C", repo.as_posix(), "config", "--get", "remote.origin.url"]
|
cmd = ["git", "-C", repo.as_posix(), "config", "--get", "remote.origin.url"]
|
||||||
result = check_output(cmd, stderr=DEVNULL)
|
result: str = check_output(cmd, stderr=DEVNULL).decode(encoding="utf-8")
|
||||||
return "/".join(result.decode().strip().split("/")[-2:])
|
substrings: List[str] = result.strip().split("/")[-2:]
|
||||||
|
return "/".join(substrings).replace(".git", "")
|
||||||
except CalledProcessError:
|
except CalledProcessError:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user