import re
from src.utils import root_path


def get_app_asset_content(pattern: str):
    assets_path = root_path().joinpath('fronted/dist/assets')
    regex = re.compile(pattern)

    for item in assets_path.iterdir():
        if regex.match(item.name):
            with open(str(item), 'r', encoding='utf-8') as f:
                return f.read()

    return 'working'
