MCPcopy Create free account
hub / github.com/crewAIInc/crewAI / initialize_if_git_available

Function initialize_if_git_available

lib/cli/src/crewai_cli/git.py:232–238  ·  view source on GitHub ↗

Initialize a Git repository when Git is available.

(path: Path)

Source from the content-addressed store, hash-verified

230
231
232def initialize_if_git_available(path: Path) -> bool:
233 """Initialize a Git repository when Git is available."""
234 if not Repository.is_git_installed():
235 return False
236
237 subprocess.run(["git", "init"], cwd=path, check=True) # noqa: S607
238 return True

Callers 4

create_crewFunction · 0.90
create_flowFunction · 0.90
create_json_crewFunction · 0.90
create_agentFunction · 0.90

Calls 2

is_git_installedMethod · 0.80
runMethod · 0.45

Tested by

no test coverage detected