20 lines
393 B
Python
20 lines
393 B
Python
import os
|
|
from pathlib import Path
|
|
|
|
|
|
def ensure_tmpfs(path):
|
|
p = Path(path)
|
|
|
|
if not p.exists():
|
|
p.mkdir(parents=True, exist_ok=True)
|
|
|
|
# NOTE: mount handled externally (systemd/fstab recommended)
|
|
|
|
|
|
def get_tmpfs_workspace(config, project_name):
|
|
base = Path(config["tmpfs_path"])
|
|
ws = base / project_name
|
|
|
|
ws.mkdir(parents=True, exist_ok=True)
|
|
return str(ws)
|