mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-09-24 20:00:30 +00:00
Initialize Git repositories for generated projects (#6364)
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Check Documentation Broken Links / Check broken links (push) Has been cancelled
Vulnerability Scan / pip-audit (push) Has been cancelled
Nightly Canary Release / Check for new commits (push) Has been cancelled
Nightly Canary Release / Build nightly packages (push) Has been cancelled
Nightly Canary Release / Publish nightly to PyPI (push) Has been cancelled
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Check Documentation Broken Links / Check broken links (push) Has been cancelled
Vulnerability Scan / pip-audit (push) Has been cancelled
Nightly Canary Release / Check for new commits (push) Has been cancelled
Nightly Canary Release / Build nightly packages (push) Has been cancelled
Nightly Canary Release / Publish nightly to PyPI (push) Has been cancelled
This commit is contained in:
@@ -201,3 +201,12 @@ class Repository:
|
||||
return result.stdout.strip()
|
||||
except subprocess.CalledProcessError:
|
||||
return None
|
||||
|
||||
|
||||
def initialize_if_git_available(path: Path) -> bool:
|
||||
"""Initialize a Git repository when Git is available."""
|
||||
if not Repository.is_git_installed():
|
||||
return False
|
||||
|
||||
subprocess.run(["git", "init"], cwd=path, check=True) # noqa: S607
|
||||
return True
|
||||
|
||||
Reference in New Issue
Block a user