From 1f5b6067658904a6ff95cc4e9f9680280aada31f Mon Sep 17 00:00:00 2001 From: cobycloud <25079070+cobycloud@users.noreply.github.com> Date: Wed, 18 Dec 2024 00:27:14 -0600 Subject: [PATCH] Update create_component.py --- scripts/create_component.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/create_component.py b/scripts/create_component.py index 7affa750..b6b25081 100644 --- a/scripts/create_component.py +++ b/scripts/create_component.py @@ -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) @@ -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