from typing import List
import shlex


def bash_and_fish_add_path(value: List[str]) -> str:
    """Renders the code to add directories to the path for bash and fish.

    :param value: A list of values to prepend to the path.
    :return: The code to prepend to path.
    """
    return "\n".join(f"add_path {shlex.quote(entry)}" for entry in reversed(value))