All files / shared/utils temp-paths.ts

75% Statements 6/8
66.66% Branches 4/6
100% Functions 1/1
75% Lines 6/8

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 1527x 27x     263x 263x       263x 263x        
import { existsSync } from "node:fs";
import { tmpdir } from "node:os";
 
export function getFastTmpBaseDir(): string {
  const configuredTempDir = process.env.UNOSIM_SHARED_TEMP_DIR?.trim();
  Iif (configuredTempDir) {
    return configuredTempDir;
  }
 
  Eif (process.platform === "linux" && existsSync("/dev/shm")) {
    return "/dev/shm";
  }
  return tmpdir();
}