Skip to content

Commit

Permalink
Update create_component.py
Browse files Browse the repository at this point in the history
  • Loading branch information
cobycloud authored Dec 18, 2024
1 parent 27ea918 commit 1f5b606
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/create_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def create_component(template_path, output_path, placeholders):
target_root = Path(replace_placeholders(str(target_root), placeholders))
target_root.mkdir(parents=True, exist_ok=True)

for file in files:
for file in files:e
template_file = Path(root) / file
target_file = target_root / replace_placeholders(file, placeholders)

Expand Down Expand Up @@ -73,8 +73,8 @@ def main():
if not all(key in placeholders for key in ["package_scope", "resource_kind", "package_name"]):
raise ValueError("Missing required placeholders: package_scope, resource_kind, package_name")

if placeholders["resource_kind"].endswith("s") != 's':
placeholders["resource_kind"] = f"{placeholders["resource_kind"]}s"
if placeholders["resource_kind"].endswith("s"):
placeholders["resource_kind"] = placeholders["resource_kind"]+s
dynamic_output_path = Path(args.output) / placeholders["package_scope"].lower() / placeholders["resource_kind"].lower() / placeholders["package_name"]

# Generate the project
Expand Down

0 comments on commit 1f5b606

Please sign in to comment.