Skip to content

Commit

Permalink
Filter out "template", "src", "test"
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Kadner <[email protected]>
  • Loading branch information
ckadner committed Sep 3, 2021
1 parent 9201347 commit abdb568
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions hack/regenerate_catalog_upload_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,10 @@ def get_list_of_yaml_files_in_katalog(asset_type: str):

yaml_files = glob(f"{katalog_dir}/{asset_type}-samples/**/*.yaml", recursive=True)

yaml_files = sorted(filter(lambda f: "template" not in f, yaml_files))
yaml_files = [filepath for filepath in yaml_files
if not any(word in filepath for word in ["template", "test", "src"])]

yaml_files = sorted(filter(lambda f: "test" not in f, yaml_files))

yaml_files = sorted(filter(lambda f: "src" not in f, yaml_files))

return yaml_files
return sorted(yaml_files)


def generate_katalog_dict() -> dict:
Expand Down Expand Up @@ -89,7 +86,9 @@ def rewrite_catalog_upload_json_files(katalog: dict):
for file_path in catalog_upload_json_files:

with open(file_path, "w") as output_file:

print(" - " + relpath(file_path, project_dir))

output_file.write(json.dumps(katalog, sort_keys=False, indent=2))
output_file.write("\n")

Expand Down

0 comments on commit abdb568

Please sign in to comment.