Skip to content

Commit

Permalink
work when git is not installed
Browse files Browse the repository at this point in the history
  • Loading branch information
jcbhmr authored Nov 13, 2024
1 parent d1ffdad commit 13af58f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions bikeshed/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -1197,10 +1197,11 @@ def getSpecRepository(doc: t.SpecT) -> repository.Repository | None:
source_dir = doc.inputSource.directory()
try:
with open(os.devnull, "wb") as fnull:
remotes = str(
subprocess.check_output(["git", "remote", "-v"], stderr=fnull, cwd=source_dir), # noqa: S603
encoding="utf-8",
)
try:
output = subprocess.check_output(["git", "remote", "-v"], stderr=fnull, cwd=source_dir), # noqa: S603
except:
return None
remotes = str(output, encoding="utf-8")
searches = [
r"origin\tgit@github\.([\w.-]+):([\w-]+)/([\w-]+)\.git \(\w+\)",
r"origin\thttps://github\.([\w.-]+)/([\w-]+)/([\w-]+)\.git \(\w+\)",
Expand Down

0 comments on commit 13af58f

Please sign in to comment.