From 2ddd28d4d497b5ca057411d5be2aa63a322aaab1 Mon Sep 17 00:00:00 2001 From: Aditya Gupta Date: Sun, 28 Jun 2026 07:47:14 +0530 Subject: [PATCH] feat: Added Multi-tool uninstallation via comma-separated arguments - If multiple uninstalled tools share a system dependency, the dependency is only uninstalled once the last tool using it is removed. --- lib/routes.sh | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/lib/routes.sh b/lib/routes.sh index 157a747..632b931 100755 --- a/lib/routes.sh +++ b/lib/routes.sh @@ -275,11 +275,20 @@ for script in "${SCRIPTS[@]}"; do if [ -z "$target" ]; then rollback_bare else - local registry_file="$BOOTSTRAP_STATE_DIR/registry.json" - if [ -f "$registry_file" ] && jq -e --arg t "$target" '.tools | has($t)' "$registry_file" >/dev/null; then - uninstall_tool "$target" + # Split comma-separated targets + IFS=',' read -ra TARGETS <<< "$target" + + if [ ${#TARGETS[@]} -gt 1 ]; then + for t in "${TARGETS[@]}"; do + uninstall_tool "$t" + done else - rollback_to_savepoint "$target" + local registry_file="$BOOTSTRAP_STATE_DIR/registry.json" + if [ -f "$registry_file" ] && jq -e --arg t "$target" '.tools | has($t)' "$registry_file" >/dev/null; then + uninstall_tool "$target" + else + rollback_to_savepoint "$target" + fi fi fi exit 0