mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-05-07 09:10:55 +00:00
Added EXIT traps to ensure temporary files are cleaned up even if scripts crash or are interrupted: **cli/spawn.sh** (2 mktemp calls): - Line 219: Added trap after mktemp in fetch_manifest(), clear trap after mv - Line 537: Added trap after mktemp in cmd_update(), clear trap after mv - Removed manual rm -f calls in error paths (trap handles cleanup) **sprite/lib/common.sh** (3 mktemp calls): - setup_shell_environment(): Consolidated trap for both path_temp and bash_temp - inject_env_vars_sprite(): Added trap for env_temp, clear after successful upload **shared/common.sh** (cleanup system): - Auto-register cleanup trap at end of file when sourced - This activates the existing track_temp_file() + cleanup_temp_files() system - Previously register_cleanup_trap() had to be manually called (only 1 script did this) Impact: Prevents /tmp file leaks when scripts are killed, crashed, or interrupted mid-execution. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| common.sh | ||