fix: cmd_destroy unbound variable $2 #192

Merged
shoko merged 1 commits from fix/issue-cmd-destroy-unbound-var into main 2026-04-06 11:30:05 +02:00
Owner

Bug

cmd_destroy line 526 uses $2 without a default:

if [ "$2" = "-y" ]; then

With set -u (nounset), this causes "unbound variable" error when called without arguments:

kugetsu destroy
# Error: $2: unbound variable

Fix

Use ${2:-} to provide empty default:

if [ "${2:-}" = "-y" ]; then
## Bug `cmd_destroy` line 526 uses `$2` without a default: ```bash if [ "$2" = "-y" ]; then ``` With `set -u` (nounset), this causes "unbound variable" error when called without arguments: ``` kugetsu destroy # Error: $2: unbound variable ``` ## Fix Use `${2:-}` to provide empty default: ```bash if [ "${2:-}" = "-y" ]; then ```
shoko added 1 commit 2026-04-06 11:24:58 +02:00
With set -u, using $2 without default causes error when called without arguments.
shoko merged commit cf8b003d2f into main 2026-04-06 11:30:05 +02:00
Sign in to join this conversation.