Skip to content

Commit

Permalink
removeprefix & removesuffix don't exist in py 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
Frank Odom committed Jul 19, 2023
1 parent d5cde8b commit 9e742d0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions templatize
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ def get_git_info(key: str) -> str:
def get_repo_owner_and_name() -> Tuple[str, str]:
owner, name = (
get_git_info("remote.origin.url")
.removeprefix("https://github.com/")
.removeprefix("git@github.com:")
.removesuffix(".git")
.replace("https://github.com/", "")
.replace("git@github.com:", "")
.replace(".git", "")
.split("/", maxsplit=1)
)
return owner, name
Expand Down

0 comments on commit 9e742d0

Please sign in to comment.