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 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | 2x 2x 2x 2x 1x 1x 1x 1x 1x 1x 2x | import fs from "fs-extra"; import os from "os"; import isElectron from "./isElectron"; const getTmp = (create = true) => { let tmpPath = os.tmpdir(); Iif (isElectron()) { // eslint-disable-next-line global-require // eslint-disable-next-line @typescript-eslint/no-var-requires const settings = require("electron-settings"); Iif (settings.get("tmpDir")) { tmpPath = settings.get("tmpDir"); } } if ( tmpPath.indexOf(" ") === -1 && tmpPath.indexOf(".itch") === -1 && (process.platform !== "win32" || tmpPath.length < 35) ) { // Ok } else Eif (process.platform === "win32") { tmpPath = "C:\\tmp"; } else tmpPath = "/tmp"; if (create) { fs.ensureDirSync(tmpPath); } return tmpPath; }; export default getTmp; |