Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion agentstack/generation/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,11 @@ def parse_line(line):
def write(self):
with open(self._path / self._filename, 'a') as f:
for key, value in self._new_variables.items():
f.write(f"\n{key}={value}")
"""
We don't want to override values the user may already have set
in their environment variables so we add a new line commented out.
"""
f.write(f"\n# {key}={value}")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

beautiful 🔥


def __enter__(self) -> 'EnvFile':
return self
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/env python
from dotenv import load_dotenv
load_dotenv(override=True)
import sys
from crew import {{cookiecutter.project_metadata.project_name|replace('-', '')|replace('_', '')|capitalize}}Crew
import agentops
from dotenv import load_dotenv
load_dotenv()

agentops.init(default_tags=['crewai', 'agentstack'])

Expand Down
Loading