-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.bat
More file actions
82 lines (71 loc) · 1.75 KB
/
start.bat
File metadata and controls
82 lines (71 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
@echo off
echo Real Estate Scraper - Windows Startup
echo =====================================
REM Check if Python is installed
python --version >nul 2>&1
if errorlevel 1 (
echo Error: Python is not installed or not in PATH
echo Please install Python 3.8+ from https://python.org
pause
exit /b 1
)
REM Check if virtual environment exists
if not exist "venv" (
echo Creating virtual environment...
python -m venv venv
if errorlevel 1 (
echo Error: Failed to create virtual environment
pause
exit /b 1
)
)
REM Activate virtual environment
echo Activating virtual environment...
call venv\Scripts\activate.bat
REM Install dependencies if needed
if not exist "venv\Lib\site-packages\flask" (
echo Installing dependencies...
pip install -r requirements.txt
if errorlevel 1 (
echo Error: Failed to install dependencies
pause
exit /b 1
)
)
REM Setup environment file if needed
if not exist ".env" (
if exist "config.env.example" (
echo Creating .env file from template...
copy config.env.example .env
echo Please edit .env file with your configuration
notepad .env
)
)
REM Check command line arguments
if "%1"=="setup" (
echo Running initial setup...
python start.py --setup
goto :end
)
if "%1"=="migrate" (
echo Running database migrations...
python start.py --migrate
goto :end
)
if "%1"=="test" (
echo Running sample scraping test...
python start.py --test
goto :end
)
if "%1"=="debug" (
echo Starting in debug mode...
python start.py --debug
goto :end
)
REM Default: start the application
echo Starting Real Estate Scraper...
python start.py
:end
echo.
echo Press any key to exit...
pause >nul