MCPcopy Index your code
hub / github.com/stitionai/devika / save_code_to_project

Method save_code_to_project

src/agents/coder/coder.py:68–80  ·  view source on GitHub ↗
(self, response: List[Dict[str, str]], project_name: str)

Source from the content-addressed store, hash-verified

66 return result
67
68 def save_code_to_project(self, response: List[Dict[str, str]], project_name: str):
69 file_path_dir = None
70 project_name = project_name.lower().replace(" ", "-")
71
72 for file in response:
73 file_path = os.path.join(self.project_dir, project_name, file['file'])
74 file_path_dir = os.path.dirname(file_path)
75 os.makedirs(file_path_dir, exist_ok=True)
76
77 with open(file_path, "w", encoding="utf-8") as f:
78 f.write(file["code"])
79
80 return file_path_dir
81
82 def get_project_path(self, project_name: str):
83 project_name = project_name.lower().replace(" ", "-")

Callers 4

make_decisionMethod · 0.45
subsequent_executeMethod · 0.45
executeMethod · 0.45
run_codeMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected