mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-28 01:28:14 +00:00
Working on creating Crew templates and pipeline templates
This commit is contained in:
20
src/crewai/cli/utils.py
Normal file
20
src/crewai/cli/utils.py
Normal file
@@ -0,0 +1,20 @@
|
||||
import click
|
||||
|
||||
|
||||
def copy_template(src, dst, name, class_name, folder_name):
|
||||
print(f"Copying {src} to {dst}")
|
||||
print(f"Interpolating {name}, {class_name}, {folder_name}")
|
||||
"""Copy a file from src to dst."""
|
||||
with open(src, "r") as file:
|
||||
content = file.read()
|
||||
|
||||
# Interpolate the content
|
||||
content = content.replace("{{name}}", name)
|
||||
content = content.replace("{{crew_name}}", class_name)
|
||||
content = content.replace("{{folder_name}}", folder_name)
|
||||
|
||||
# Write the interpolated content to the new file
|
||||
with open(dst, "w") as file:
|
||||
file.write(content)
|
||||
|
||||
click.secho(f" - Created {dst}", fg="green")
|
||||
Reference in New Issue
Block a user