Skip to content

Commit

Permalink
# Fix Issue 576: Compatibility with GitHub CLI v. >2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
antoneskov committed Jun 3, 2022
1 parent 9987261 commit fe8fc68
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion webviz_config/_deployment/github_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import tempfile
import subprocess
from pathlib import Path
import os


def binary_available() -> bool:
Expand Down Expand Up @@ -62,7 +63,21 @@ def create_github_repository(github_slug: str, directory: Path) -> Path:
cwd=directory,
)

return directory / github_slug.split("/")[1]
# Fix Issue 576: Compatibility with Github CLI v. >2.2
clone_path = directory / github_slug.split("/")[1]

if not os.path.exists(clone_path):
subprocess.run(
["gh", "repo", "clone", github_slug],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
# capture_output=True, <-- Added in Python 3.7
check=True,
cwd=directory,
)


return clone_path


def turn_on_github_vulnerability_alers(directory: Path) -> None:
Expand Down

0 comments on commit fe8fc68

Please sign in to comment.