def check_local_node_packs(node_packs):
    """Raise error if issues are found in local node packs."""

    ### check whether node packs exist

    for path in node_packs:

        if not path.exists():

            raise NodePackNotFoundError(
                f"the '{path}' node pack path wasn't found",
                path,
            )

    ### check whether node packs are directories

    for path in node_packs:

        if not path.is_dir():

            raise NodePackNotADirectoryError(
                f"the '{path}' node pack isn't a directory",
                path,
            )

    ### check whether each node pack has at least
    ### one script

    for node_pack in node_packs:

        category_folders = [
            path
            for path in node_pack.iterdir()
            if path.is_dir()
            if not path.name.startswith(".")
            if not path.name == "__pycache__"
        ]

        if not category_folders:

            raise NodePackLackingCategoryError(
                f"node pack '{node_pack}' must have at least 1 category",
                node_pack,
            )

        for category_folder in category_folders:

            script_dirs = [
                path
                for path in category_folder.iterdir()
                if path.is_dir()
                if not path.name.startswith(".")
                if not path.name == "__pycache__"
            ]

            if not script_dirs:

                raise CategoryLackingScriptDirectoryError(
                    (
                        f"category dir '{category_folder}'"
                        " must have at least 1 script"
                        " directory"
                    ),
                    node_pack,
                )

            for script_dir in script_dirs:

                script_file = script_dir / NODE_SCRIPT_NAME

                if not script_file.is_file():

                    raise ScriptDirectoryLackingScriptError(
                        node_pack,
                        category_folder,
                        script_dir,
                        script_file,
                    )
Raise error if issues are found in local node packs.
nodezator/graphman/nodepacksissues.py