from textwrap import dedent


def fish_variable(variable_name: str, value: str):
    """Render the code to backup and set a variable in fish.

    :param variable_name: The name of the variable.
    :param value: The new value to set the variable to.
    :return: The code to backup and set the variable.
    """
    return dedent(
        f'''\
        set -gx CONDA_DEVENV_BKP_{variable_name} ${variable_name}
        set -gx {variable_name} "{value}"'''
    )