Skip to content

Commit aea8ac8

Browse files
committed
dont check before install, rather after
1 parent d52e178 commit aea8ac8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/gitfetch/fetcher.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ def __init__(self, token: Optional[str] = None):
1818
Args:
1919
token: Optional GitHub personal access token (ignored, uses gh CLI)
2020
"""
21-
# Check if gh CLI is installed and authenticated
22-
self._check_gh_cli()
21+
pass
2322

2423
def _check_gh_cli(self) -> None:
2524
"""Check if GitHub CLI is installed and authenticated."""
@@ -59,6 +58,7 @@ def _gh_api(self, endpoint: str, method: str = "GET") -> Any:
5958
Returns:
6059
Parsed JSON response
6160
"""
61+
self._check_gh_cli()
6262
try:
6363
result = subprocess.run(
6464
['gh', 'api', endpoint, '-X', method],
@@ -84,6 +84,7 @@ def fetch_user_data(self, username: str) -> Dict[str, Any]:
8484
Returns:
8585
Dictionary containing user profile data
8686
"""
87+
self._check_gh_cli()
8788
return self._gh_api(f'/users/{username}')
8889

8990
def fetch_user_stats(self, username: str, user_data: Optional[Dict[str, Any]] = None) -> Dict[str, Any]:
@@ -97,6 +98,7 @@ def fetch_user_stats(self, username: str, user_data: Optional[Dict[str, Any]] =
9798
Returns:
9899
Dictionary containing user statistics
99100
"""
101+
self._check_gh_cli()
100102
repos = self._fetch_repos(username)
101103

102104
total_stars = sum(repo.get('stargazers_count', 0) for repo in repos)

0 commit comments

Comments
 (0)