Implement code review suggestions: add newline parameter and UnicodeDecodeError handling

Co-Authored-By: Joe Moura <joao@crewai.com>
This commit is contained in:
Devin AI
2025-04-29 11:58:28 +00:00
parent 2995478a69
commit f095f3e6c8
3 changed files with 57 additions and 27 deletions

View File

@@ -28,7 +28,7 @@ def create_flow(name):
(project_root / "tests").mkdir(exist_ok=True)
# Create .env file
with open(project_root / ".env", "w", encoding="utf-8") as file:
with open(project_root / ".env", "w", encoding="utf-8", newline="\n") as file:
file.write("OPENAI_API_KEY=YOUR_API_KEY")
package_dir = Path(__file__).parent
@@ -58,7 +58,7 @@ def create_flow(name):
content = content.replace("{{flow_name}}", class_name)
content = content.replace("{{folder_name}}", folder_name)
with open(dst_file, "w", encoding="utf-8") as file:
with open(dst_file, "w", encoding="utf-8", newline="\n") as file:
file.write(content)
# Copy and process root template files