From 05a77c9c7d9895649893cfac28b155d46900560c Mon Sep 17 00:00:00 2001 From: ValhallaBuilder <286693580+4gjnbzb4zf-sudo@users.noreply.github.com> Date: Sun, 7 Jun 2026 19:27:58 -0400 Subject: [PATCH] fix(cli): preserve uninstall feedback when a named target hits empty registry When the operator runs `spark uninstall ` on a machine with no installed modules, the command silently swallowed the named target and printed the generic "No installed Spark modules recorded." with exit 0. That hides a typo or stale-state condition behind a success surface. Preserve the named target in the message and return a non-zero exit so the operator sees that the requested module was not found. The `--all` path keeps its current message and exit code. --- src/spark_cli/cli.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/spark_cli/cli.py b/src/spark_cli/cli.py index 3a468664..26ec7e60 100644 --- a/src/spark_cli/cli.py +++ b/src/spark_cli/cli.py @@ -15869,13 +15869,19 @@ def cmd_uninstall(args: argparse.Namespace) -> int: failures += cmd_autostart_uninstall(argparse.Namespace()) if not modules: - print("No installed Spark modules recorded.") + named_target = args.target if not getattr(args, "all", False) else None + if named_target: + print(f"Unknown installed module: {named_target}. No modules are installed; run `spark install` first.") + else: + print("No installed Spark modules recorded.") if getattr(args, "remove_user_path", False): removed = remove_spark_bin_from_windows_user_path() print("Removed Spark bin from Windows user PATH." if removed else "Spark bin was not present in Windows user PATH.") if getattr(args, "purge_home", False): removed_home = purge_spark_home() print(f"Removed Spark home: {SPARK_HOME}" if removed_home else f"Spark home was not present: {SPARK_HOME}") + if named_target: + return 1 return 1 if failures else 0 removed_names: list[str] = [] for module in modules: