Skip to content

Commit

Permalink
Use CWD for component namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-bc committed Jul 25, 2023
1 parent c546df5 commit 4414a65
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/fprime/util/cookiecutter_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,14 @@ def new_component(build: Build):
)
print("[INFO] Cookiecutter source: using builtin")

final_component_dir = Path(cookiecutter(source)).resolve()
# Use current working directory name as default namespace, unless at project root
extra_context = {}
if not proj_root.samefile(Path.cwd()):
extra_context["component_namespace"] = Path.cwd().name

final_component_dir = Path(
cookiecutter(source, extra_context=extra_context)
).resolve()

if proj_root is None:
print(
Expand Down

0 comments on commit 4414a65

Please sign in to comment.