Skip to content

Commit c31b006

Browse files
committed
debug: add static directory logging for troubleshoo
ting
1 parent d21d2a7 commit c31b006

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/scribbl_py/plugin.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,30 +40,42 @@ def _get_static_directory() -> Path:
4040
Returns:
4141
Path to the static files directory.
4242
"""
43-
# Check environment variable first (for custom deployments)
4443
import os
44+
import sys
4545

46+
# Check environment variable first (for custom deployments)
4647
env_static = os.environ.get("SCRIBBL_STATIC_DIR")
4748
if env_static:
4849
env_path = Path(env_static)
4950
if env_path.exists():
51+
print(f"[Scribbl] Static dir from env: {env_path}", file=sys.stderr)
5052
return env_path
5153

5254
# Check Docker standard location (/app/frontend/dist)
5355
docker_path = Path("/app/frontend/dist")
5456
if docker_path.exists():
57+
print(f"[Scribbl] Static dir (Docker): {docker_path}", file=sys.stderr)
58+
# List contents for debugging
59+
try:
60+
contents = list(docker_path.iterdir())
61+
print(f"[Scribbl] Static contents: {contents}", file=sys.stderr)
62+
except OSError as e:
63+
print(f"[Scribbl] Could not list static dir: {e}", file=sys.stderr)
5564
return docker_path
5665

5766
# Look for frontend/dist relative to project root
5867
current = Path(__file__).parent
5968
while current != current.parent:
6069
frontend_dist = current / "frontend" / "dist"
6170
if frontend_dist.exists():
71+
print(f"[Scribbl] Static dir (relative): {frontend_dist}", file=sys.stderr)
6272
return frontend_dist
6373
current = current.parent
6474

6575
# Fallback to a path relative to the package
66-
return Path(__file__).parent.parent.parent.parent / "frontend" / "dist"
76+
fallback = Path(__file__).parent.parent.parent.parent / "frontend" / "dist"
77+
print(f"[Scribbl] Static dir (fallback): {fallback}, exists={fallback.exists()}", file=sys.stderr)
78+
return fallback
6779

6880

6981
@dataclass

0 commit comments

Comments
 (0)