UNPKG

myst-cli

Version:
11 lines (10 loc) 382 B
import fs from 'node:fs'; import path from 'node:path'; import os from 'os'; export function createTempFolder(session) { if (!session) return fs.mkdtempSync(path.join(os.tmpdir(), 'myst')); const tempLocation = path.join(session.buildPath(), 'temp'); fs.mkdirSync(tempLocation, { recursive: true }); return fs.mkdtempSync(path.join(tempLocation, 'myst')); }