from pathlib import Path


def __overwrite_file(output_path: Path, overwrite: bool) -> bool:
    """
    If not automatically overwriting, ask the user if they want to continue

    Either delete the file and continue, or return that choice.

    :param output_path: Path
    :param overwrite: bool
    :return: bool
    """
    if not overwrite:
        print(f'File \'{output_path.as_posix()}\' exists!')
        do_del = input('Delete/overwrite? [y/N] ')
        if do_del == 'y':
            output_path.unlink()
            output_path.touch()
        else:
            print('Not continuing.')
            return False
    else:
        output_path.unlink()
        output_path.touch()
    return True