mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
Align temp directory resolution with os.tmpdir() (#25878)
## Summary - Aligns Bun's temp directory resolution with Node.js's `os.tmpdir()` behavior - Checks `TMPDIR`, `TMP`, and `TEMP` environment variables in order (matching Node.js) - Uses `bun.once` for lazy initialization instead of mutable static state - Removes `setTempdir` function and simplifies the API to use `RealFS.tmpdirPath()` directly ## Test plan - [ ] Verify temp directory resolution matches Node.js behavior - [ ] Test with various environment variable configurations - [ ] Ensure existing tests pass with `bun bd test` 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1128,6 +1128,7 @@ async function spawnBun(execPath, { args, cwd, timeout, env, stdout, stderr }) {
|
||||
...process.env,
|
||||
PATH: path,
|
||||
TMPDIR: tmpdirPath,
|
||||
BUN_TMPDIR: tmpdirPath,
|
||||
USER: username,
|
||||
HOME: homedir,
|
||||
SHELL: shellPath,
|
||||
|
||||
Reference in New Issue
Block a user