kugetsu destroy --base -y fails with "target is required" in v0.2.9 #183

Closed
opened 2026-04-06 06:12:41 +02:00 by shoko · 0 comments
Owner

Bug

In v0.2.9, kugetsu destroy --base -y fails with Error: target is required.

Root cause: cmd_destroy() in kugetsu-session.sh line 482 sets target="" when = "--base". Then line 490 checks if [ -z "" ] which is now true and exits before reaching line 517 where --base is actually handled.

# Line 482-496
if [ "$target" = "--base" ]; then
    target=""      # ← sets target to empty string
fi

if [ -z "$target" ]; then
    echo "Error: target is required" >&2  # ← exits here before --base handling
    ...
    exit 1
fi

elif [ "$target" = "--base" ]; then  # ← never reached

Affected versions: v0.2.9

Reproduction

kugetsu destroy --base -y
# Error: target is required

Fix

Remove or restructure the early target="" assignment on line 482-484. The --base handling at line 517 should be reached directly.

## Bug In v0.2.9, `kugetsu destroy --base -y` fails with `Error: target is required`. **Root cause:** `cmd_destroy()` in `kugetsu-session.sh` line 482 sets `target=""` when ` = "--base"`. Then line 490 checks `if [ -z "" ]` which is now true and exits before reaching line 517 where `--base` is actually handled. ```bash # Line 482-496 if [ "$target" = "--base" ]; then target="" # ← sets target to empty string fi if [ -z "$target" ]; then echo "Error: target is required" >&2 # ← exits here before --base handling ... exit 1 fi elif [ "$target" = "--base" ]; then # ← never reached ``` **Affected versions:** v0.2.9 ## Reproduction ```bash kugetsu destroy --base -y # Error: target is required ``` ## Fix Remove or restructure the early `target=""` assignment on line 482-484. The `--base` handling at line 517 should be reached directly.
shoko added the bug label 2026-04-06 06:12:41 +02:00
shoko closed this issue 2026-04-06 07:08:43 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: shoko/kugetsu#183