Skip to content

Commit ba0296c

Browse files
authored
fix: init command (#442)
# Motivation <!-- Why is this change necessary? --> # Content <!-- Please include a summary of the change --> # Testing <!-- How was the change tested? --> # Please check the following before marking your PR as ready for review - [ ] I have added tests for my changes - [ ] I have updated the documentation or added new documentation as needed
1 parent 0d41b3d commit ba0296c

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

src/codegen/cli/workspace/initialize_workspace.py

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -82,18 +82,17 @@ def initialize_codegen(
8282
modify_gitignore(CODEGEN_FOLDER)
8383

8484
# Create or update config.toml with basic repo info
85-
if not session: # Only create if session doesn't exist (it handles config itself)
86-
org_name, repo_name = get_git_organization_and_repo(repo)
87-
config = {}
88-
if CONFIG_PATH.exists():
89-
config = toml.load(CONFIG_PATH)
90-
config.update(
91-
{
92-
"organization_name": config.get("organization_name", org_name),
93-
"repo_name": config.get("repo_name", repo_name),
94-
}
95-
)
96-
CONFIG_PATH.write_text(toml.dumps(config))
85+
org_name, repo_name = get_git_organization_and_repo(repo)
86+
config = {}
87+
if CONFIG_PATH.exists():
88+
config = toml.load(CONFIG_PATH)
89+
config.update(
90+
{
91+
"organization_name": config.get("organization_name", org_name),
92+
"repo_name": config.get("repo_name", repo_name),
93+
}
94+
)
95+
CONFIG_PATH.write_text(toml.dumps(config))
9796

9897
# Create notebook template
9998
create_notebook(JUPYTER_DIR)

0 commit comments

Comments
 (0)