def main()

in scripts/copy_druid_docs.py [0:0]


def main(druid_version, source_directory="../../druid"):
    is_valid, error_msg = check_source(source_directory)
    if not is_valid:
        quit(error_msg + "\n")

    # The destination_directory should be druid-website-src/docs/VERSION
    destination_directory = f"../docs/{druid_version}"
    destination_directory_latest = "../docs/latest"

    # Copies the docs
    copy_tree(source_directory+"/docs", destination_directory)

    # deletes the _bin directory that's not needed
    shutil.rmtree(f"{destination_directory}/_bin")

    # Copy sidebars.json and redirects.json
    shutil.copyfile(source_directory+"/website/sidebars.json", "../sidebars.json")
    shutil.copyfile(source_directory+"/website/redirects.js", "../redirects.js")

    do_the_replace(destination_directory, druid_version)

    is_it_latest(druid_version, source_directory, destination_directory_latest)