from pathlib import Path


def outfile_path() -> Path:
    """Path to directory for output files. Created if doesn't exist.

    If OneDrive is set up, outfile_path is in OneDrive. Otherwise,
    it is in the home directory. Relative path: '.pyAppOut/graeScript'.
    """
    outpath = Path.home() / '.pyAppOut/graeScript'
    if (Path.home() / 'OneDrive').is_dir():
        outpath = Path.home() / 'OneDrive/.pyAppOut/graeScript'
    outpath.mkdir(parents=True, exist_ok=True)
    return outpath