Migrate to Poetry packaging and restructure codebase #21
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user
⚠️ Potential issue | 🟡 Minor
Make the file executable or remove the shebang.
The shebang is present but the file is not executable.
Based on static analysis hints, run:
Or remove the shebang if the script is only intended to be invoked via
python scripts/prepare_frontend_dir.py.🧰 Tools
🪛 Ruff (0.14.6)
1-1: Shebang is present but file is not executable
(EXE001)
🤖 Prompt for AI Agents
✅ Addressed in commits
ac839dftoc98131f🛠️ Refactor suggestion | 🟠 Major
Add safety checks before removing the directory.
The script unconditionally removes the target directory without validation. If the
TARGETpath is misconfigured or if there's a symlink, this could lead to unintended data loss.Consider adding basic safety checks:
✅ Addressed in commits
ac839dftoc98131f