Use TMPDIR environment variable in install script (#35636)
Anne Schuth
created
## Summary
This PR updates the install script to respect the `TMPDIR` environment
variable when creating temporary directories.
## Motivation
Some environments have non-standard temporary directory locations or
restrictions on `/tmp`. This change allows users to specify an
alternative temporary directory by setting the `TMPDIR` environment
variable.
## Changes
- Check if `TMPDIR` is set and points to a valid directory
- Use `$TMPDIR` for temporary files if available
- Fall back to `/tmp` if `TMPDIR` is not set or invalid
## Testing
Tested the script with:
- `TMPDIR` unset (uses `/tmp` as before)
- `TMPDIR` set to a valid directory (uses specified directory)
- `TMPDIR` set to an invalid path (falls back to `/tmp`)
This change maintains backward compatibility while adding flexibility
for environments with non-standard temporary directory requirements.
Release Notes:
- N/A