Skip to content

fix(stackctl): replace Bash 4+ associative array with POSIX-safe function#508

Merged
wax911 merged 1 commit into
devfrom
fix/stackctl-bash-portability
Jun 26, 2026
Merged

fix(stackctl): replace Bash 4+ associative array with POSIX-safe function#508
wax911 merged 1 commit into
devfrom
fix/stackctl-bash-portability

Conversation

@wax911

@wax911 wax911 commented Jun 26, 2026

Copy link
Copy Markdown
Member

Closes #501.

Replaces local -A dir_to_stack=() (Bash 4+ only) in _secrets_deploy() with a linear-scan _dir_to_stack() function. macOS ships Bash 3.2 which does not support associative arrays. Also removes 2>/dev/null from the generator call so errors are visible.

@wax911 wax911 left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The shell change itself is the right direction: replacing local -A with a linear lookup keeps the script compatible with older Bash implementations.

Blocking concern: this PR also commits .slim/deepwork/issues-500-505.md, which is unrelated to #501 and duplicates planning/handoff context that now belongs on issues, especially #505. The issue #505 comment already defines the override direction and explicitly defers that work to a dedicated session, so this implementation PR should not carry a broad deepwork planning artifact.

Please remove the .slim/deepwork file from this PR and keep the change focused on stackctl.sh. The stackctl fix itself looks acceptable after that cleanup.

@wax911 wax911 force-pushed the fix/stackctl-bash-portability branch from cc4a957 to b67ec08 Compare June 26, 2026 22:44
…tion

Replaces local -A dir_to_stack=() (Bash 4+ only) in _secrets_deploy() with
a linear-scan _dir_to_stack() function. macOS ships Bash 3.2 which does not
support associative arrays. Also removes 2>/dev/null from the generator
call so errors are visible.

Ref: #501
@wax911 wax911 force-pushed the fix/stackctl-bash-portability branch from b67ec08 to f7c2368 Compare June 26, 2026 22:49
@wax911 wax911 merged commit 64057fb into dev Jun 26, 2026
2 checks passed
@wax911 wax911 deleted the fix/stackctl-bash-portability branch June 26, 2026 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(stackctl): align shell syntax with supported Bash version contract

1 participant