diff --git a/main.py b/main.py index 57c9b8e..2d2a717 100644 --- a/main.py +++ b/main.py @@ -54,6 +54,9 @@ # Enable compression for all responses Compress(app) +# Ensure data directory exists before initializing the database +os.makedirs("data", exist_ok=True) + # Initialize database on startup init_db() diff --git a/start-librecrawl.bat b/start-librecrawl.bat index bf2621b..9a9e0d6 100644 --- a/start-librecrawl.bat +++ b/start-librecrawl.bat @@ -1,5 +1,6 @@ @echo off +if not exist data mkdir data echo Checking for Docker... docker --version 2>nul if errorlevel 1 goto nodocker diff --git a/start-librecrawl.sh b/start-librecrawl.sh index 7c9a979..dbfbac9 100644 --- a/start-librecrawl.sh +++ b/start-librecrawl.sh @@ -2,6 +2,7 @@ # Start LibreCrawl - tries Docker first, falls back to Python +mkdir -p data echo "Checking for Docker..." if command -v docker &> /dev/null && command -v docker compose &> /dev/null; then echo "Docker found! Starting LibreCrawl with Docker..."