AUTHOR
FIREWHEEL Team
DONE
DESCRIPTION
Uninstall a repository of model components. The repository should be an
existing directory on the filesystem. The path may be specified absolute or
relative.

.. warning::

    This does **NOT** uninstall any actions performed by Model Component ``INSTALL`` scripts.

Example
+++++++
``firewheel repository uninstall <directory>``
DONE
RUN Python ON control
#!/usr/bin/env python

import argparse
from pathlib import Path

from rich.console import Console

from firewheel.control.repository_db import RepositoryDb

con = Console()
parser = argparse.ArgumentParser(
    description="Uninstall a new Model Component repository!"
)

parser.add_argument("path", help="The path to the repository to uninstall.")

args = parser.parse_args()

PATH = Path(args.path)
# Convert whatever path we were given to an absolute path.
REPO_ENTRY = {"path": str(PATH.resolve())}

RESULT = RepositoryDb().delete_repository(REPO_ENTRY)
if RESULT is None:
    con.print(
        f"[yellow]Attempted to uninstall repository [cyan]{PATH}[/cyan]. Operation pending."
    )
elif RESULT > 0:
    con.print(f"[b green]Removed repository: [cyan]{PATH}[/cyan]")
else:
    con.print(f"[b red]Failed to remove repository: [cyan]{PATH}[/cyan]")
DONE
