mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 10:28:47 +00:00
Fix tmpdir in Windows
This commit is contained in:
@@ -695,14 +695,14 @@ function getTmpdir() {
|
||||
if (isWindows) {
|
||||
for (const key of ["TMPDIR", "TEMP", "TEMPDIR", "TMP", "RUNNER_TEMP"]) {
|
||||
const tmpdir = process.env[key] || "";
|
||||
if (!/^\/[a-z]\//i.test(tmpdir)) {
|
||||
continue;
|
||||
}
|
||||
// HACK: There are too many bugs with cygwin directories.
|
||||
// We should probably run Windows tests in both cygwin and powershell.
|
||||
if (/cygwin|cygdrive/i.test(tmpdir)) {
|
||||
continue;
|
||||
}
|
||||
if (!/^[a-z]/i.test(tmpdir)) {
|
||||
continue;
|
||||
}
|
||||
const driveLetter = tmpdir[1];
|
||||
return normalizeWindows(`${driveLetter.toUpperCase()}:${tmpdir.substring(2)}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user