# Use TMPDIR environment variable in install script \(\#35636\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/3bee803b518ee2a8d82bf63cb2dacbe98366103d)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 3bee803b518ee2a8d82bf63cb2dacbe98366103d

Requested commit: 3bee803b518ee2a8d82bf63cb2dacbe98366103d

Commit: 3bee803b518ee2a8d82bf63cb2dacbe98366103d

Tree: d83939c1e0a760f5898c50bed4b96422094a81d1

Author: Anne Schuth

Committer: GitHub

## Message

```
Use TMPDIR environment variable in install script (#35636)

## 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
```

## Parents

- [2c7251e4f9177e047b58f53f7b3f8fed9e928fa1](https://git.cafe/gitcafe/zed/commit/2c7251e4f9177e047b58f53f7b3f8fed9e928fa1?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/3bee803b518ee2a8d82bf63cb2dacbe98366103d?format=markdown)
