11 lines
313 B
Python
11 lines
313 B
Python
from pathlib import Path
|
|
|
|
|
|
OVERLAY_ROOT = Path("/opt/l4d2/overlays").resolve()
|
|
|
|
|
|
def validate_overlay_path(raw: str) -> Path:
|
|
path = Path(raw).resolve()
|
|
if OVERLAY_ROOT not in path.parents and path != OVERLAY_ROOT:
|
|
raise ValueError("overlay path must be under /opt/l4d2/overlays")
|
|
return path
|