Skip to content
Prev Previous commit
Next Next commit
Use separate file connections for reading and writing
  • Loading branch information
dbeatty10 committed May 23, 2023
commit 79a083e36f10e0389ff44cbdf59598df68d18b89
5 changes: 2 additions & 3 deletions core/dbt/task/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,11 +250,10 @@ def get_valid_project_name(self) -> str:
def create_new_project(self, project_name: str):
self.copy_starter_repo(project_name)
os.chdir(project_name)
with open("dbt_project.yml", "r+") as f:
with open("dbt_project.yml", "r") as f:
content = f"{f.read()}".format(project_name=project_name, profile_name=project_name)
f.seek(0)
with open("dbt_project.yml", "w") as f:
f.write(content)
f.truncate()
fire_event(
ProjectCreated(
project_name=project_name,
Expand Down