from pathlib import Path


def clean_path(path):
    """
    Cleans the path to allow it to be used to search with glob.

    It does a few different things:
    - Replaces ~ with the users home directory.
    - Makes sure the path ends with a /

    param: path: The path to clean.
    returns: The cleaned path.
    """
    path = path.replace("~", str(Path.home()))
    if path[-1] != "/":
        path += "/"
    return path