from pathlib import Path


def input_custom_variables(string: str, dmvio_folder: str):
    """ Replace the following environment variables in the given string.
    if ${EVALPATH} is inside string it is replaced with the path to the evaltools (the folder where this file is
    located).
    ${DMVIO_PATH} is replaced with the path to DM-VIO.
    """
    return string.replace('${EVALPATH}', str(Path(__file__).parent.parent.resolve())).replace('${DMVIO_PATH}',
                                                                                              dmvio_folder)