diff --git a/scripts/prepare_frontend_dir.py b/scripts/prepare_frontend_dir.py index a88c1bc..881c5e1 100644 --- a/scripts/prepare_frontend_dir.py +++ b/scripts/prepare_frontend_dir.py @@ -1,10 +1,14 @@ -#!/usr/bin/env python3 from pathlib import Path import shutil TARGET = Path("meshchatx") / "public" +if not Path("pyproject.toml").exists(): + raise RuntimeError("Must run from project root") + if TARGET.exists(): + if TARGET.is_symlink(): + raise RuntimeError(f"{TARGET} is a symlink, refusing to remove") shutil.rmtree(TARGET) TARGET.mkdir(parents=True, exist_ok=True)