Skip to content

Commit fe8fc68

Browse files
committed
# Fix Issue 576: Compatibility with GitHub CLI v. >2.2
1 parent 9987261 commit fe8fc68

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

webviz_config/_deployment/github_cli.py

+16-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import tempfile
44
import subprocess
55
from pathlib import Path
6+
import os
67

78

89
def binary_available() -> bool:
@@ -62,7 +63,21 @@ def create_github_repository(github_slug: str, directory: Path) -> Path:
6263
cwd=directory,
6364
)
6465

65-
return directory / github_slug.split("/")[1]
66+
# Fix Issue 576: Compatibility with Github CLI v. >2.2
67+
clone_path = directory / github_slug.split("/")[1]
68+
69+
if not os.path.exists(clone_path):
70+
subprocess.run(
71+
["gh", "repo", "clone", github_slug],
72+
stdout=subprocess.PIPE,
73+
stderr=subprocess.PIPE,
74+
# capture_output=True, <-- Added in Python 3.7
75+
check=True,
76+
cwd=directory,
77+
)
78+
79+
80+
return clone_path
6681

6782

6883
def turn_on_github_vulnerability_alers(directory: Path) -> None:

0 commit comments

Comments
 (0)