Skip to content
Open
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
10 changes: 5 additions & 5 deletions livecomponents/management/commands/createlivecomponent.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,14 @@ def handle(self, *args, **options):
component_path = app_path / "components" / component_name
component_path.mkdir(parents=True, exist_ok=True)

# Create __init__.py files for all the parent directories of the component
# Create __init__.py files for all the directories of the component
# file down to "components" directory.
parent_path = component_path.parent
while parent_path != app_path / "components":
init_py = parent_path / "__init__.py"
package_path = component_path
while package_path != app_path / "components":
init_py = package_path / "__init__.py"
if not init_py.exists():
init_py.touch()
parent_path = parent_path.parent
package_path = package_path.parent

component_py = component_path / f"{proper_name}.py"
component_html = component_path / f"{proper_name}.html"
Expand Down