Skip to content

fix: install scripts trap unbound variable on exit (s0.18) - #59

Merged
elmol merged 1 commit into
mainfrom
fix/s0.18-install-trap-fix
Mar 20, 2026
Merged

fix: install scripts trap unbound variable on exit (s0.18)#59
elmol merged 1 commit into
mainfrom
fix/s0.18-install-trap-fix

Conversation

@elmol

@elmol elmol commented Mar 20, 2026

Copy link
Copy Markdown
Owner

Summary

  • Both install-device.sh and install-attester.sh errored on exit with bash: tmp: variable sin asignar because the tmp local variable was out of scope when the EXIT trap fired under set -u
  • Moved temp dir to module-scope TMP_DIR with a cleanup() function so the trap always has a valid reference
  • set -euo pipefail remains intact — no workarounds

Test plan

  • Run install-device.sh on RPi — exits cleanly with no unbound variable error
  • Run install-attester.sh on Linux/macOS — exits cleanly
  • Temp directory is still removed on exit

🤖 Generated with Claude Code

Move tmp variable from local scope in main() to module-scope TMP_DIR
with a cleanup() function. The EXIT trap now references a variable that
is always in scope, fixing the "variable sin asignar" error under set -u.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@elmol
elmol merged commit 9e14e01 into main Mar 20, 2026
8 checks passed
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.

1 participant