Skip to content

fix: hoist nullglob bad-example trap to global scope - #14

Merged
posidoni merged 1 commit into
mainfrom
fix/nullglob-bad-example-trap-scope
Jul 14, 2026
Merged

fix: hoist nullglob bad-example trap to global scope#14
posidoni merged 1 commit into
mainfrom
fix/nullglob-bad-example-trap-scope

Conversation

@posidoni

Copy link
Copy Markdown
Owner

Summary

  • move mktemp/trap EXIT in examples/bash/04-nullglob-empty-match.bad.sh out of the main() ( ... ) subshell to global scope, mirroring the paired .good.sh
  • fixes a temp-dir leak under Bash 3.2 (macOS default), where an EXIT trap defined inside a subshell never fires

Closes #13.

Validation

  • task ci
  • task hooks

EXIT traps set inside a subshell function don't fire under Bash 3.2
(macOS default), leaking the temp dir. Mirrors the fix already applied
to the paired .good.sh.

Closes #13.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request moves the creation of a temporary directory and its corresponding cleanup trap from the subshell-based 'main' function to the global scope in 'examples/bash/04-nullglob-empty-match.bad.sh'. This ensures that the cleanup trap is properly registered and executed on script exit. There are no review comments, and I have no additional feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@posidoni
posidoni merged commit 23fa8e0 into main Jul 14, 2026
4 checks passed
@posidoni
posidoni deleted the fix/nullglob-bad-example-trap-scope branch July 14, 2026 16:46
@posidoni

Copy link
Copy Markdown
Owner Author

Merged. Closes out the last outstanding nit from gemini-code-assist's review of #12 (temp-dir leak under Bash 3.2) — thanks to that review for catching it. Repo's clean across all four example domains now.

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.

nullglob bad-example leaks temp dir under Bash 3.2 (EXIT trap in subshell)

1 participant