diff --git a/file_manager.py b/file_manager.py index f31af0c..9b0f400 100644 --- a/file_manager.py +++ b/file_manager.py @@ -2,8 +2,8 @@ import datetime import json import logging import os -import shutil import re +import shutil supported_versions = ["bukkit", "paper", "spigot"] @@ -102,6 +102,15 @@ def get_path_from_extension(filename) -> str or None: return None +def filter_directory_contents(desired_extension: str, directory_contents: list[str]): + filtered_list = [] + for item in directory_contents: + _, ext = os.path.splitext(item) + if ext.lower() == desired_extension: + filtered_list.append(item) + return filtered_list + + def kebab_to_camel_case(s: str) -> str: parts = s.split('-') return parts[0] + ''.join(part.title() for part in parts[1:])