Skip to content

Commit

Permalink
Merge pull request #1034 from googlefonts/pack-fix1
Browse files Browse the repository at this point in the history
utils: fix github_user_repo so Exo-2.0 works
  • Loading branch information
m4rc1e authored Sep 26, 2024
2 parents b5bb703 + afc2fe5 commit a2b3549
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Lib/gftools/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,9 @@ def shell_quote(s: Union[str, Path]) -> str:


def github_user_repo(github_url):
pattern = r"https?://w?w?w?\.?github\.com/(?P<user>[^/]+)/(?P<repo>[^/^.]+)"
if github_url.endswith(".git"):
github_url = github_url[:-4]
pattern = r"https?://w?w?w?\.?github\.com/(?P<user>[^/]+)/(?P<repo>[^/]+)"
match = re.search(pattern, github_url)
if not match:
raise ValueError(
Expand Down
1 change: 1 addition & 0 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ def test_format_html():
("googlefonts", "MavenPro"),
),
("http://www.github.com/googlefonts/MavenPro.git", ("googlefonts", "MavenPro")),
("http://www.github.com/NDISCOVER/Exo-2.0.git", ("NDISCOVER", "Exo-2.0")),
],
)
def test_github_user_repo(url, want):
Expand Down

0 comments on commit a2b3549

Please sign in to comment.