from pathlib import Path


def get_first_dir(cwd: Path, glob: str = "*"):
    """ Return first directory of pattern `glob`. """
    for d in cwd.glob(glob):
        if d.is_dir():
            return d
    raise OSError(str(cwd))