def copy_tree(
    src: str | Path,
    dest: str | Path,
    ignore: tuple[str, ...] | None = None,
):
    """Copy a directory tree.

    Args:
        src: The path to the source directory.
        dest: The path to the destination directory.
        ignore: Ignoring files and directories that match one of the glob-style patterns provided
    """
    src = Path(src)
    dest = Path(dest)
    if dest.exists():
        for item in dest.iterdir():
            rm(item)
    shutil.copytree(
        src,
        dest,
        ignore=shutil.ignore_patterns(*ignore) if ignore is not None else ignore,
        dirs_exist_ok=True,
    )
Copy a directory tree.

    Args:
        src: The path to the source directory.
        dest: The path to the destination directory.
        ignore: Ignoring files and directories that match one of the glob-style patterns provided
    
reflex/utils/path_ops.py