Run git command asynchronously
(self, args: List[str], cwd: str)
| 220 | raise Exception(f"| ❌ Failed to clone repository: {str(e)}") |
| 221 | |
| 222 | async def _run_git_command(self, args: List[str], cwd: str) -> str: |
| 223 | """Run git command asynchronously""" |
| 224 | process = await asyncio.create_subprocess_exec( |
| 225 | 'git', *args, |
| 226 | cwd=cwd, |
| 227 | stdout=asyncio.subprocess.PIPE, |
| 228 | stderr=asyncio.subprocess.PIPE |
| 229 | ) |
| 230 | stdout, stderr = await process.communicate() |
| 231 | if process.returncode != 0: |
| 232 | error_msg = stderr.decode().strip() or stdout.decode().strip() |
| 233 | raise Exception(f"Git command failed (exit {process.returncode}): {error_msg}") |
| 234 | return stdout.decode().strip() |
| 235 | |
| 236 | async def _setup_leetcode_cookie(self): |
| 237 | """Use Playwright to login and extract cookies to bypass Cloudflare 403""" |
no test coverage detected