Open History to see the last commit
1// @effect-diagnostics nodeBuiltinImport:off - runs once at test setup, outside any Effect runtime.
2import * as NodeFS from "node:fs";
3import * as NodeOS from "node:os";
4import * as HostProcess from "../HostProcess.ts";
5
6// GitHub's Windows runners hand out the temp directory by its 8.3 short name
7// (C:\Users\RUNNER~1\...). Anything that canonicalises a path, such as git or
8// realpath, reports the long form, so equality checks between a temp path and
9// its canonical form fail.
10if (HostProcess.Platform.defaultValue() === "win32") {
11 try {
12 const longForm = NodeFS.realpathSync.native(NodeOS.tmpdir());
13 process.env.TEMP = longForm;
14 process.env.TMP = longForm;
15 } catch {}
16}