All files / shared/utils temp-paths.ts

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

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 15        96x 96x       96x 96x        
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();
}