@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 04:45 UTC

main
ts 21 lines 876 Bytes
Raw
1 // @effect-diagnostics nodeBuiltinImport:off - one synchronous probe at module load, outside any Effect runtime.
2 import * as NodeFS from "node:fs";
3 import * as NodeOS from "node:os";
4 import * as NodePath from "node:path";
5
6 /** Skip symlink fixtures when unsupported; Windows requires Developer Mode or elevation. */
7 export const symlinksSupported: boolean = (() => {
8 let directory: string | undefined;
9 try {
10 directory = NodeFS.mkdtempSync(NodePath.join(NodeOS.tmpdir(), "t3-symlink-probe-"));
11 NodeFS.symlinkSync(NodePath.join(directory, "target"), NodePath.join(directory, "link"));
12 return true;
13 } catch {
14 return false;
15 } finally {
16 // Cleanup EPERM/EBUSY must not fail module initialization or decide symlink support.
17 try {
18 if (directory !== undefined) NodeFS.rmSync(directory, { recursive: true, force: true });
19 } catch {}
20 }
21 })();